File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -622,10 +622,8 @@ pub const Lua = opaque {
622622 /// Initialize a Lua state with the given allocator. Use `Lua.deinit()` to close the state and free memory.
623623 ///
624624 /// Creates a new independent state and returns its main thread.
625- /// Returns NULL if it cannot create the state (due to lack of memory).
626- /// The argument f is the allocator function; Lua will do all memory allocation
627- /// for this state through this function (see lua_Alloc). The second argument,
628- /// ud, is an opaque pointer that Lua passes to the allocator in every call.
625+ /// Returns an error if it cannot create the state (due to lack of memory).
626+ /// Lua will do all memory allocation for this state through the passed Allocator (see lua_Alloc).
629627 ///
630628 /// * Pops: `0`
631629 /// * Pushes: `0`
@@ -640,7 +638,6 @@ pub const Lua = opaque {
640638 const allocator_ptr = try a .create (Allocator );
641639 allocator_ptr .* = a ;
642640
643- // @constCast() is safe here because Lua does not mutate the pointer internally
644641 if (c .lua_newstate (alloc , allocator_ptr )) | state | {
645642 return @ptrCast (state );
646643 } else return error .OutOfMemory ;
You can’t perform that action at this time.
0 commit comments