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 {
622
622
/// Initialize a Lua state with the given allocator. Use `Lua.deinit()` to close the state and free memory.
623
623
///
624
624
/// 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).
629
627
///
630
628
/// * Pops: `0`
631
629
/// * Pushes: `0`
@@ -640,7 +638,6 @@ pub const Lua = opaque {
640
638
const allocator_ptr = try a .create (Allocator );
641
639
allocator_ptr .* = a ;
642
640
643
- // @constCast() is safe here because Lua does not mutate the pointer internally
644
641
if (c .lua_newstate (alloc , allocator_ptr )) | state | {
645
642
return @ptrCast (state );
646
643
} else return error .OutOfMemory ;
You can’t perform that action at this time.
0 commit comments