diff options
author | Benoit Germain <bnt.germain@gmail.com> | 2018-10-30 14:22:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 14:22:26 +0100 |
commit | 68351edc78bf87683f3a44241b1281e0f08c7a50 (patch) | |
tree | 657da27f7b215bb0de409c7136339e1d09eac29d /src | |
parent | c93b471549bfb266074f38c69a75299db8c2808b (diff) | |
parent | 2beda6902327b11e3be2d30407a200a28f8fdee7 (diff) | |
download | lanes-68351edc78bf87683f3a44241b1281e0f08c7a50.tar.gz lanes-68351edc78bf87683f3a44241b1281e0f08c7a50.tar.bz2 lanes-68351edc78bf87683f3a44241b1281e0f08c7a50.zip |
Merge pull request #151 from sonoro1234/PROPAGATE_ALLOCF_GC64
let manually define PROPAGATE_ALLOCF (needed for LuaJIT GC64)
Diffstat (limited to 'src')
-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) |