diff --git a/lanes-3.16.0-0.rockspec b/lanes-3.16.1-0.rockspec similarity index 97% rename from lanes-3.16.0-0.rockspec rename to lanes-3.16.1-0.rockspec index 55bbfb41..65115a16 100644 --- a/lanes-3.16.0-0.rockspec +++ b/lanes-3.16.1-0.rockspec @@ -7,11 +7,11 @@ package = "Lanes" -version = "3.16.0-0" +version = "3.16.1-0" source= { url= "git+https://github.com/LuaLanes/lanes.git", - branch= "v3.16.0" + branch= "v3.16.1" } description = { diff --git a/src/keeper.c b/src/keeper.c index f4dde0a0..8aa734aa 100644 --- a/src/keeper.c +++ b/src/keeper.c @@ -612,7 +612,7 @@ void close_keepers( Universe* U) // free the keeper bookkeeping structure { AllocatorDefinition* const allocD = &U->internal_allocator; - allocD->allocF( allocD->allocUD, U->keepers, sizeof( Keepers) + (nbKeepers - 1) * sizeof( Keeper), 0); + (void) allocD->allocF( allocD->allocUD, U->keepers, sizeof( Keepers) + (nbKeepers - 1) * sizeof( Keeper), 0); U->keepers = NULL; } } diff --git a/src/lanes.c b/src/lanes.c index 0aab244a..d2c95ee7 100644 --- a/src/lanes.c +++ b/src/lanes.c @@ -255,7 +255,7 @@ static void lane_cleanup( Lane* s) { AllocatorDefinition* const allocD = &s->U->internal_allocator; - allocD->allocF(allocD->allocUD, s, sizeof(Lane), 0); + (void) allocD->allocF(allocD->allocUD, s, sizeof(Lane), 0); } } @@ -1225,10 +1225,10 @@ LUAG_FUNC( lane_new) // 's' is allocated from heap, not Lua, since its life span may surpass the handle's (if free running thread) // // a Lane full userdata needs a single uservalue - ud = lua_newuserdatauv( L, sizeof( Lane*), 1); // func libs priority globals package required gc_cb lane + ud = lua_newuserdatauv( L, sizeof( Lane*), 1); // func libs priority globals package required gc_cb lane { AllocatorDefinition* const allocD = &U->internal_allocator; - s = *ud = (Lane*)allocD->allocF(allocD->allocUD, NULL, 0, sizeof(Lane)); + s = *ud = (Lane*) allocD->allocF(allocD->allocUD, NULL, 0, sizeof(Lane)); } if( s == NULL) { diff --git a/src/linda.c b/src/linda.c index 390816b4..8b597900 100644 --- a/src/linda.c +++ b/src/linda.c @@ -797,8 +797,7 @@ static void* linda_id( lua_State* L, DeepOp op_) { Universe* const U = universe_get(L); AllocatorDefinition* const allocD = &U->internal_allocator; - - s = (struct s_Linda*)allocD->allocF(allocD->allocUD, NULL, 0, sizeof(struct s_Linda) + name_len); // terminating 0 is already included + s = (struct s_Linda*) allocD->allocF(allocD->allocUD, NULL, 0, sizeof(struct s_Linda) + name_len); // terminating 0 is already included } if( s) { @@ -835,8 +834,7 @@ static void* linda_id( lua_State* L, DeepOp op_) { Universe* const U = universe_get(L); AllocatorDefinition* const allocD = &U->internal_allocator; - - allocD->allocF(allocD->allocUD, linda, sizeof(struct s_Linda) + strlen(linda->name), 0); + (void) allocD->allocF(allocD->allocUD, linda, sizeof(struct s_Linda) + strlen(linda->name), 0); } return NULL; } diff --git a/src/state.c b/src/state.c index ef708422..21ca3978 100644 --- a/src/state.c +++ b/src/state.c @@ -259,7 +259,7 @@ lua_State* create_state( Universe* U, lua_State* from_) lua_pushcclosure( from_, U->provide_allocator, 0); lua_call( from_, 0, 1); { - AllocatorDefinition* def = lua_touserdata( from_, -1); + AllocatorDefinition* const def = lua_touserdata( from_, -1); L = lua_newstate( def->allocF, def->allocUD); } lua_pop( from_, 1); diff --git a/src/tools.c b/src/tools.c index 5a6ae92f..80e0f711 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; diff --git a/tests/basic.lua b/tests/basic.lua index 7bbcbb37..385e22f9 100644 --- a/tests/basic.lua +++ b/tests/basic.lua @@ -7,7 +7,7 @@ -- - ... -- -local require_lanes_result_1, require_lanes_result_2 = require "lanes".configure{ with_timers = false} +local require_lanes_result_1, require_lanes_result_2 = require "lanes".configure{ with_timers = false, internal_allocator = "libc"} print( "require_lanes_result:", require_lanes_result_1, require_lanes_result_2) local lanes = require_lanes_result_1 diff --git a/tests/linda_perf.lua b/tests/linda_perf.lua index fa2d6332..a170b01a 100644 --- a/tests/linda_perf.lua +++ b/tests/linda_perf.lua @@ -78,7 +78,6 @@ end local tests1 = { - --[[ { 10000, 2000000, 0}, { 10000, 2000000, 1}, { 10000, 2000000, 2}, @@ -88,7 +87,6 @@ local tests1 = { 10000, 2000000, 13}, { 10000, 2000000, 21}, { 10000, 2000000, 44}, - --]] } print "############################################\ntests #1" for k, v in pairs( tests1) do