aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBenoit Germain <bnt.germain@gmail.com>2018-10-30 14:22:26 +0100
committerGitHub <noreply@github.com>2018-10-30 14:22:26 +0100
commit68351edc78bf87683f3a44241b1281e0f08c7a50 (patch)
tree657da27f7b215bb0de409c7136339e1d09eac29d /src
parentc93b471549bfb266074f38c69a75299db8c2808b (diff)
parent2beda6902327b11e3be2d30407a200a28f8fdee7 (diff)
downloadlanes-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.h2
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)