aboutsummaryrefslogtreecommitdiff
path: root/src/tools.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools.c')
-rw-r--r--src/tools.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tools.c b/src/tools.c
index 754605b..b5f2f4b 100644
--- a/src/tools.c
+++ b/src/tools.c
@@ -570,13 +570,14 @@ void populate_func_lookup_table( lua_State* L, int _i, char const* name_)
570lua_State* luaG_newstate( lua_State* _from, int const _on_state_create, char const* libs) 570lua_State* luaG_newstate( lua_State* _from, int const _on_state_create, char const* libs)
571{ 571{
572 // reuse alloc function from the originating state 572 // reuse alloc function from the originating state
573 void* allocUD; 573#if PROPAGATE_ALLOCF
574 lua_Alloc allocF = lua_getallocf( _from, &allocUD); 574 PROPAGATE_ALLOCF_PREP( _from);
575 lua_State* L = lua_newstate( allocF, allocUD); 575#endif // PROPAGATE_ALLOCF
576 lua_State* L = PROPAGATE_ALLOCF_ALLOC();
576 577
577 if( L == NULL) 578 if( L == NULL)
578 { 579 {
579 (void) luaL_error( _from, "'lua_newstate()' failed; out of memory"); 580 (void) luaL_error( _from, "luaG_newstate() failed while creating state; out of memory");
580 } 581 }
581 582
582 // we'll need this everytime we transfer some C function from/to this state 583 // we'll need this everytime we transfer some C function from/to this state