From 2beda6902327b11e3be2d30407a200a28f8fdee7 Mon Sep 17 00:00:00 2001 From: sonoro1234 Date: Mon, 29 Oct 2018 10:29:05 +0100 Subject: let manually define PROPAGATE_ALLOCF (needed for LuaJIT GC64) --- src/macros_and_utils.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/macros_and_utils.h b/src/macros_and_utils.h index 2a619b3..9d73d50 100644 --- a/src/macros_and_utils.h +++ b/src/macros_and_utils.h @@ -13,6 +13,7 @@ #endif // For some reason, LuaJIT 64bits doesn't support lua_newstate() +#ifndef PROPAGATE_ALLOCF //you should #define PROPAGATE_ALLOCF 1 for LuaJIT in GC64 mode #if defined(LUA_JITLIBNAME) && (defined(__x86_64__) || defined(_M_X64)) //#pragma message( "LuaJIT 64 bits detected: don't propagate allocf") #define PROPAGATE_ALLOCF 0 @@ -20,6 +21,7 @@ //#pragma message( "PUC-Lua detected: propagate allocf") #define PROPAGATE_ALLOCF 1 #endif // LuaJIT x64 +#endif // PROPAGATE_ALLOCF defined #if PROPAGATE_ALLOCF #define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD) #define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD) -- cgit v1.2.3-55-g6feb