From f7245f66295752306ee58c1a9be0ed01b653e347 Mon Sep 17 00:00:00 2001 From: Benoit Germain Date: Wed, 16 Aug 2023 09:59:15 +0200 Subject: Minor tweaks --- src/tools.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/tools.c') diff --git a/src/tools.c b/src/tools.c index 5a6ae92..80e0f71 100644 --- a/src/tools.c +++ b/src/tools.c @@ -155,6 +155,7 @@ void luaG_dump( lua_State* L) // ################################################################################################ +// same as PUC-Lua l_alloc static void* libc_lua_Alloc(void* ud, void* ptr, size_t osize, size_t nsize) { (void)ud; (void)osize; /* not used */ @@ -182,7 +183,7 @@ static void* protected_lua_Alloc( void *ud, void *ptr, size_t osize, size_t nsiz static int luaG_provide_protected_allocator( lua_State* L) { Universe* U = universe_get( L); - AllocatorDefinition* def = lua_newuserdatauv( L, sizeof(AllocatorDefinition), 0); + AllocatorDefinition* const def = lua_newuserdatauv( L, sizeof(AllocatorDefinition), 0); def->allocF = protected_lua_Alloc; def->allocUD = &U->protected_allocator; return 1; @@ -236,7 +237,7 @@ void initialize_allocator_function( Universe* U, lua_State* L) lua_getfield( L, -1, "internal_allocator"); // settings "libc"|"allocator" { char const* allocator = lua_tostring( L, -1); - if (stricmp(allocator, "libc") == 0) + if (strcmp(allocator, "libc") == 0) { U->internal_allocator.allocF = libc_lua_Alloc; U->internal_allocator.allocUD = NULL; -- cgit v1.2.3-55-g6feb