diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tools.h b/src/tools.h index 2609ce9..b868440 100644 --- a/src/tools.h +++ b/src/tools.h | |||
| @@ -17,16 +17,18 @@ | |||
| 17 | #endif | 17 | #endif |
| 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 | ||
| 21 | #if defined(LUA_LJDIR) && (defined(__x86_64__) || defined(_M_X64)) | 20 | #if defined(LUA_LJDIR) && (defined(__x86_64__) || defined(_M_X64)) |
| 22 | #define PROPAGATE_ALLOCF 0 | 21 | #define PROPAGATE_ALLOCF 0 |
| 22 | #else // LuaJIT x64 | ||
| 23 | #define PROPAGATE_ALLOCF 1 | ||
| 24 | #endif // LuaJIT x64 | ||
| 25 | #if PROPAGATE_ALLOCF | ||
| 23 | #define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD) | 26 | #define PROPAGATE_ALLOCF_PREP( L) void* allocUD; lua_Alloc allocF = lua_getallocf( L, &allocUD) |
| 24 | #define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD) | 27 | #define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD) |
| 25 | #else // luaJIT x64 | 28 | #else // PROPAGATE_ALLOCF |
| 26 | #define PROPAGATE_ALLOCF 1 | ||
| 27 | #define PROPAGATE_ALLOCF_PREP( L) | 29 | #define PROPAGATE_ALLOCF_PREP( L) |
| 28 | #define PROPAGATE_ALLOCF_ALLOC() luaL_newstate() | 30 | #define PROPAGATE_ALLOCF_ALLOC() luaL_newstate() |
| 29 | #endif // luaJIT x64 | 31 | #endif // PROPAGATE_ALLOCF |
| 30 | 32 | ||
| 31 | #define USE_DEBUG_SPEW 0 | 33 | #define USE_DEBUG_SPEW 0 |
| 32 | #if USE_DEBUG_SPEW | 34 | #if USE_DEBUG_SPEW |
