diff options
| author | sonoro1234 <sonoro@telefonica.net> | 2018-10-29 10:29:05 +0100 |
|---|---|---|
| committer | sonoro1234 <sonoro@telefonica.net> | 2018-10-29 10:29:05 +0100 |
| commit | 2beda6902327b11e3be2d30407a200a28f8fdee7 (patch) | |
| tree | 80f87d1c440f4c79c86b825966c612b39a164c57 | |
| parent | debc6b3403077fc5bd1d144d779806fdd22ab55e (diff) | |
| download | lanes-2beda6902327b11e3be2d30407a200a28f8fdee7.tar.gz lanes-2beda6902327b11e3be2d30407a200a28f8fdee7.tar.bz2 lanes-2beda6902327b11e3be2d30407a200a28f8fdee7.zip | |
let manually define PROPAGATE_ALLOCF (needed for LuaJIT GC64)
| -rw-r--r-- | src/macros_and_utils.h | 2 |
1 files changed, 2 insertions, 0 deletions
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 @@ | |||
| 13 | #endif | 13 | #endif |
| 14 | 14 | ||
| 15 | // For some reason, LuaJIT 64bits doesn't support lua_newstate() | 15 | // For some reason, LuaJIT 64bits doesn't support lua_newstate() |
| 16 | #ifndef PROPAGATE_ALLOCF //you should #define PROPAGATE_ALLOCF 1 for LuaJIT in GC64 mode | ||
| 16 | #if defined(LUA_JITLIBNAME) && (defined(__x86_64__) || defined(_M_X64)) | 17 | #if defined(LUA_JITLIBNAME) && (defined(__x86_64__) || defined(_M_X64)) |
| 17 | //#pragma message( "LuaJIT 64 bits detected: don't propagate allocf") | 18 | //#pragma message( "LuaJIT 64 bits detected: don't propagate allocf") |
| 18 | #define PROPAGATE_ALLOCF 0 | 19 | #define PROPAGATE_ALLOCF 0 |
| @@ -20,6 +21,7 @@ | |||
| 20 | //#pragma message( "PUC-Lua detected: propagate allocf") | 21 | //#pragma message( "PUC-Lua detected: propagate allocf") |
| 21 | #define PROPAGATE_ALLOCF 1 | 22 | #define PROPAGATE_ALLOCF 1 |
| 22 | #endif // LuaJIT x64 | 23 | #endif // LuaJIT x64 |
| 24 | #endif // PROPAGATE_ALLOCF defined | ||
| 23 | #if PROPAGATE_ALLOCF | 25 | #if PROPAGATE_ALLOCF |
| 24 | #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) |
| 25 | #define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD) | 27 | #define PROPAGATE_ALLOCF_ALLOC() lua_newstate( allocF, allocUD) |
