diff options
author | Mike Pall <mike> | 2016-06-03 06:42:35 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2016-06-03 06:52:53 +0200 |
commit | 58ca165737363af4800683577f2a6cc92e640dcc (patch) | |
tree | d55f22202888145d1c60da5c81de26a29f0d88ad | |
parent | 7d4340230468dc0436d761da0aaa6dc18f572bec (diff) | |
download | luajit-58ca165737363af4800683577f2a6cc92e640dcc.tar.gz luajit-58ca165737363af4800683577f2a6cc92e640dcc.tar.bz2 luajit-58ca165737363af4800683577f2a6cc92e640dcc.zip |
LJ_GC64: Allow optional use of the system memory allocator.
-rw-r--r-- | src/Makefile | 4 | ||||
-rw-r--r-- | src/lib_aux.c | 6 | ||||
-rw-r--r-- | src/lj_state.c | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile index 16aeba19..fb5fdcb7 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -121,8 +121,8 @@ XCFLAGS= | |||
121 | # | 121 | # |
122 | # Use the system provided memory allocator (realloc) instead of the | 122 | # Use the system provided memory allocator (realloc) instead of the |
123 | # bundled memory allocator. This is slower, but sometimes helpful for | 123 | # bundled memory allocator. This is slower, but sometimes helpful for |
124 | # debugging. This option cannot be enabled on x64, since realloc usually | 124 | # debugging. This option cannot be enabled on x64 without GC64, since |
125 | # doesn't return addresses in the right address range. | 125 | # realloc usually doesn't return addresses in the right address range. |
126 | # OTOH this option is mandatory for Valgrind's memcheck tool on x64 and | 126 | # OTOH this option is mandatory for Valgrind's memcheck tool on x64 and |
127 | # the only way to get useful results from it for all other architectures. | 127 | # the only way to get useful results from it for all other architectures. |
128 | #XCFLAGS+= -DLUAJIT_USE_SYSMALLOC | 128 | #XCFLAGS+= -DLUAJIT_USE_SYSMALLOC |
diff --git a/src/lib_aux.c b/src/lib_aux.c index 0e61d951..d6f56e30 100644 --- a/src/lib_aux.c +++ b/src/lib_aux.c | |||
@@ -302,7 +302,7 @@ static int panic(lua_State *L) | |||
302 | 302 | ||
303 | #ifdef LUAJIT_USE_SYSMALLOC | 303 | #ifdef LUAJIT_USE_SYSMALLOC |
304 | 304 | ||
305 | #if LJ_64 && !defined(LUAJIT_USE_VALGRIND) | 305 | #if LJ_64 && !LJ_GC64 && !defined(LUAJIT_USE_VALGRIND) |
306 | #error "Must use builtin allocator for 64 bit target" | 306 | #error "Must use builtin allocator for 64 bit target" |
307 | #endif | 307 | #endif |
308 | 308 | ||
@@ -334,7 +334,7 @@ LUALIB_API lua_State *luaL_newstate(void) | |||
334 | lua_State *L; | 334 | lua_State *L; |
335 | void *ud = lj_alloc_create(); | 335 | void *ud = lj_alloc_create(); |
336 | if (ud == NULL) return NULL; | 336 | if (ud == NULL) return NULL; |
337 | #if LJ_64 | 337 | #if LJ_64 && !LJ_GC64 |
338 | L = lj_state_newstate(lj_alloc_f, ud); | 338 | L = lj_state_newstate(lj_alloc_f, ud); |
339 | #else | 339 | #else |
340 | L = lua_newstate(lj_alloc_f, ud); | 340 | L = lua_newstate(lj_alloc_f, ud); |
@@ -343,7 +343,7 @@ LUALIB_API lua_State *luaL_newstate(void) | |||
343 | return L; | 343 | return L; |
344 | } | 344 | } |
345 | 345 | ||
346 | #if LJ_64 | 346 | #if LJ_64 && !LJ_GC64 |
347 | LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) | 347 | LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) |
348 | { | 348 | { |
349 | UNUSED(f); UNUSED(ud); | 349 | UNUSED(f); UNUSED(ud); |
diff --git a/src/lj_state.c b/src/lj_state.c index 66bf439f..a3bfc45e 100644 --- a/src/lj_state.c +++ b/src/lj_state.c | |||
@@ -180,7 +180,7 @@ static void close_state(lua_State *L) | |||
180 | g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0); | 180 | g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0); |
181 | } | 181 | } |
182 | 182 | ||
183 | #if LJ_64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC)) | 183 | #if LJ_64 && !LJ_GC64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC)) |
184 | lua_State *lj_state_newstate(lua_Alloc f, void *ud) | 184 | lua_State *lj_state_newstate(lua_Alloc f, void *ud) |
185 | #else | 185 | #else |
186 | LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) | 186 | LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) |