aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tools.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tools.h b/src/tools.h
index 8e8bb7d..2609ce9 100644
--- a/src/tools.h
+++ b/src/tools.h
@@ -18,14 +18,15 @@
18 18
19// For some reason, LuaJIT 64bits doesn't support lua_newstate() 19// For some reason, LuaJIT 64bits doesn't support lua_newstate()
20// If you build specifically for this situation, change value to 0 20// If you build specifically for this situation, change value to 0
21#define PROPAGATE_ALLOCF 1 21#if defined(LUA_LJDIR) && (defined(__x86_64__) || defined(_M_X64))
22#if PROPAGATE_ALLOCF 22#define PROPAGATE_ALLOCF 0
23#define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD) 23#define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD)
24#define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD) 24#define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD)
25#else // PROPAGATE_ALLOCF 25#else // luaJIT x64
26#define PROPAGATE_ALLOCF 1
26#define PROPAGATE_ALLOCF_PREP( L) 27#define PROPAGATE_ALLOCF_PREP( L)
27#define PROPAGATE_ALLOCF_ALLOC() luaL_newstate() 28#define PROPAGATE_ALLOCF_ALLOC() luaL_newstate()
28#endif // PROPAGATE_ALLOCF 29#endif // luaJIT x64
29 30
30#define USE_DEBUG_SPEW 0 31#define USE_DEBUG_SPEW 0
31#if USE_DEBUG_SPEW 32#if USE_DEBUG_SPEW