summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile6
-rw-r--r--src/lib_aux.c2
-rw-r--r--src/lj_state.c2
3 files changed, 6 insertions, 4 deletions
diff --git a/src/Makefile b/src/Makefile
index 9551781a..c558003c 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -122,8 +122,10 @@ XCFLAGS=
122# 122#
123# Use the system provided memory allocator (realloc) instead of the 123# Use the system provided memory allocator (realloc) instead of the
124# bundled memory allocator. This is slower, but sometimes helpful for 124# bundled memory allocator. This is slower, but sometimes helpful for
125# debugging. It's helpful for Valgrind's memcheck tool, too. This option 125# debugging. This option cannot be enabled on x64, since realloc usually
126# cannot be enabled on x64, since the built-in allocator is mandatory. 126# doesn't return addresses in the right address range.
127# OTOH this option is mandatory for Valgrind's memcheck tool on x64 and
128# the only way to get useful results from it for all other architectures.
127#XCFLAGS+= -DLUAJIT_USE_SYSMALLOC 129#XCFLAGS+= -DLUAJIT_USE_SYSMALLOC
128# 130#
129# This define is required to run LuaJIT under Valgrind. The Valgrind 131# This define is required to run LuaJIT under Valgrind. The Valgrind
diff --git a/src/lib_aux.c b/src/lib_aux.c
index 1b01fe07..e88dc7c2 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 305#if LJ_64 && !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
diff --git a/src/lj_state.c b/src/lj_state.c
index f972fdce..b9eaef46 100644
--- a/src/lj_state.c
+++ b/src/lj_state.c
@@ -175,7 +175,7 @@ static void close_state(lua_State *L)
175 g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0); 175 g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0);
176} 176}
177 177
178#if LJ_64 178#if LJ_64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC))
179lua_State *lj_state_newstate(lua_Alloc f, void *ud) 179lua_State *lj_state_newstate(lua_Alloc f, void *ud)
180#else 180#else
181LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) 181LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)