mirror of
https://github.com/LuaJIT/LuaJIT.git
synced 2025-02-07 23:24:09 +00:00
Merge branch 'master' into v2.1
This commit is contained in:
commit
c8d1aff0ba
@ -119,8 +119,10 @@ XCFLAGS=
|
|||||||
#
|
#
|
||||||
# Use the system provided memory allocator (realloc) instead of the
|
# Use the system provided memory allocator (realloc) instead of the
|
||||||
# bundled memory allocator. This is slower, but sometimes helpful for
|
# bundled memory allocator. This is slower, but sometimes helpful for
|
||||||
# debugging. It's helpful for Valgrind's memcheck tool, too. This option
|
# debugging. This option cannot be enabled on x64, since realloc usually
|
||||||
# cannot be enabled on x64, since the built-in allocator is mandatory.
|
# doesn't return addresses in the right address range.
|
||||||
|
# OTOH this option is mandatory for Valgrind's memcheck tool on x64 and
|
||||||
|
# the only way to get useful results from it for all other architectures.
|
||||||
#XCFLAGS+= -DLUAJIT_USE_SYSMALLOC
|
#XCFLAGS+= -DLUAJIT_USE_SYSMALLOC
|
||||||
#
|
#
|
||||||
# This define is required to run LuaJIT under Valgrind. The Valgrind
|
# This define is required to run LuaJIT under Valgrind. The Valgrind
|
||||||
|
@ -302,7 +302,7 @@ static int panic(lua_State *L)
|
|||||||
|
|
||||||
#ifdef LUAJIT_USE_SYSMALLOC
|
#ifdef LUAJIT_USE_SYSMALLOC
|
||||||
|
|
||||||
#if LJ_64
|
#if LJ_64 && !defined(LUAJIT_USE_VALGRIND)
|
||||||
#error "Must use builtin allocator for 64 bit target"
|
#error "Must use builtin allocator for 64 bit target"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -625,6 +625,8 @@ static size_t gc_onestep(lua_State *L)
|
|||||||
case GCSsweep: {
|
case GCSsweep: {
|
||||||
MSize old = g->gc.total;
|
MSize old = g->gc.total;
|
||||||
setmref(g->gc.sweep, gc_sweep(g, mref(g->gc.sweep, GCRef), GCSWEEPMAX));
|
setmref(g->gc.sweep, gc_sweep(g, mref(g->gc.sweep, GCRef), GCSWEEPMAX));
|
||||||
|
lua_assert(old >= g->gc.total);
|
||||||
|
g->gc.estimate -= old - g->gc.total;
|
||||||
if (gcref(*mref(g->gc.sweep, GCRef)) == NULL) {
|
if (gcref(*mref(g->gc.sweep, GCRef)) == NULL) {
|
||||||
if (g->strnum <= (g->strmask >> 2) && g->strmask > LJ_MIN_STRTAB*2-1)
|
if (g->strnum <= (g->strmask >> 2) && g->strmask > LJ_MIN_STRTAB*2-1)
|
||||||
lj_str_resize(L, g->strmask >> 1); /* Shrink string table. */
|
lj_str_resize(L, g->strmask >> 1); /* Shrink string table. */
|
||||||
@ -638,8 +640,6 @@ static size_t gc_onestep(lua_State *L)
|
|||||||
g->gc.debt = 0;
|
g->gc.debt = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lua_assert(old >= g->gc.total);
|
|
||||||
g->gc.estimate -= old - g->gc.total;
|
|
||||||
return GCSWEEPMAX*GCSWEEPCOST;
|
return GCSWEEPMAX*GCSWEEPCOST;
|
||||||
}
|
}
|
||||||
case GCSfinalize:
|
case GCSfinalize:
|
||||||
|
@ -178,7 +178,7 @@ static void close_state(lua_State *L)
|
|||||||
g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0);
|
g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if LJ_64
|
#if LJ_64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC))
|
||||||
lua_State *lj_state_newstate(lua_Alloc f, void *ud)
|
lua_State *lj_state_newstate(lua_Alloc f, void *ud)
|
||||||
#else
|
#else
|
||||||
LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
|
LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud)
|
||||||
|
@ -618,6 +618,7 @@ static TValue *trace_state(lua_State *L, lua_CFunction dummy, void *ud)
|
|||||||
}
|
}
|
||||||
lj_opt_split(J);
|
lj_opt_split(J);
|
||||||
lj_opt_sink(J);
|
lj_opt_sink(J);
|
||||||
|
if (!J->loopref) J->cur.snap[J->cur.nsnap-1].count = SNAPCOUNT_DONE;
|
||||||
J->state = LJ_TRACE_ASM;
|
J->state = LJ_TRACE_ASM;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user