diff options
author | Mike Pall <mike> | 2014-04-22 11:29:05 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2014-04-22 11:29:05 +0200 |
commit | c8d1aff0bafcbfadb4a119685708c19788158cd6 (patch) | |
tree | 9501d4b89549058b727c386aac980da075df4995 | |
parent | 39acdb8b7f8542373d6a47538f9a712baa8fe7d6 (diff) | |
parent | 2715fe3aee7c8202b4b5d04748d1c5faa6d8fd9c (diff) | |
download | luajit-c8d1aff0bafcbfadb4a119685708c19788158cd6.tar.gz luajit-c8d1aff0bafcbfadb4a119685708c19788158cd6.tar.bz2 luajit-c8d1aff0bafcbfadb4a119685708c19788158cd6.zip |
Merge branch 'master' into v2.1
-rw-r--r-- | src/Makefile | 6 | ||||
-rw-r--r-- | src/lib_aux.c | 2 | ||||
-rw-r--r-- | src/lj_gc.c | 4 | ||||
-rw-r--r-- | src/lj_state.c | 2 | ||||
-rw-r--r-- | src/lj_trace.c | 1 |
5 files changed, 9 insertions, 6 deletions
diff --git a/src/Makefile b/src/Makefile index 722efc33..fae4c7ba 100644 --- a/src/Makefile +++ b/src/Makefile | |||
@@ -119,8 +119,10 @@ XCFLAGS= | |||
119 | # | 119 | # |
120 | # Use the system provided memory allocator (realloc) instead of the | 120 | # Use the system provided memory allocator (realloc) instead of the |
121 | # bundled memory allocator. This is slower, but sometimes helpful for | 121 | # bundled memory allocator. This is slower, but sometimes helpful for |
122 | # debugging. It's helpful for Valgrind's memcheck tool, too. This option | 122 | # debugging. This option cannot be enabled on x64, since realloc usually |
123 | # cannot be enabled on x64, since the built-in allocator is mandatory. | 123 | # doesn't return addresses in the right address range. |
124 | # OTOH this option is mandatory for Valgrind's memcheck tool on x64 and | ||
125 | # the only way to get useful results from it for all other architectures. | ||
124 | #XCFLAGS+= -DLUAJIT_USE_SYSMALLOC | 126 | #XCFLAGS+= -DLUAJIT_USE_SYSMALLOC |
125 | # | 127 | # |
126 | # This define is required to run LuaJIT under Valgrind. The Valgrind | 128 | # 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_gc.c b/src/lj_gc.c index 8fea9853..376c9d09 100644 --- a/src/lj_gc.c +++ b/src/lj_gc.c | |||
@@ -625,6 +625,8 @@ static size_t gc_onestep(lua_State *L) | |||
625 | case GCSsweep: { | 625 | case GCSsweep: { |
626 | MSize old = g->gc.total; | 626 | MSize old = g->gc.total; |
627 | setmref(g->gc.sweep, gc_sweep(g, mref(g->gc.sweep, GCRef), GCSWEEPMAX)); | 627 | setmref(g->gc.sweep, gc_sweep(g, mref(g->gc.sweep, GCRef), GCSWEEPMAX)); |
628 | lua_assert(old >= g->gc.total); | ||
629 | g->gc.estimate -= old - g->gc.total; | ||
628 | if (gcref(*mref(g->gc.sweep, GCRef)) == NULL) { | 630 | if (gcref(*mref(g->gc.sweep, GCRef)) == NULL) { |
629 | if (g->strnum <= (g->strmask >> 2) && g->strmask > LJ_MIN_STRTAB*2-1) | 631 | if (g->strnum <= (g->strmask >> 2) && g->strmask > LJ_MIN_STRTAB*2-1) |
630 | lj_str_resize(L, g->strmask >> 1); /* Shrink string table. */ | 632 | lj_str_resize(L, g->strmask >> 1); /* Shrink string table. */ |
@@ -638,8 +640,6 @@ static size_t gc_onestep(lua_State *L) | |||
638 | g->gc.debt = 0; | 640 | g->gc.debt = 0; |
639 | } | 641 | } |
640 | } | 642 | } |
641 | lua_assert(old >= g->gc.total); | ||
642 | g->gc.estimate -= old - g->gc.total; | ||
643 | return GCSWEEPMAX*GCSWEEPCOST; | 643 | return GCSWEEPMAX*GCSWEEPCOST; |
644 | } | 644 | } |
645 | case GCSfinalize: | 645 | case GCSfinalize: |
diff --git a/src/lj_state.c b/src/lj_state.c index 73611ac8..444f269d 100644 --- a/src/lj_state.c +++ b/src/lj_state.c | |||
@@ -178,7 +178,7 @@ static void close_state(lua_State *L) | |||
178 | g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0); | 178 | g->allocf(g->allocd, G2GG(g), sizeof(GG_State), 0); |
179 | } | 179 | } |
180 | 180 | ||
181 | #if LJ_64 | 181 | #if LJ_64 && !(defined(LUAJIT_USE_VALGRIND) && defined(LUAJIT_USE_SYSMALLOC)) |
182 | lua_State *lj_state_newstate(lua_Alloc f, void *ud) | 182 | lua_State *lj_state_newstate(lua_Alloc f, void *ud) |
183 | #else | 183 | #else |
184 | LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) | 184 | LUA_API lua_State *lua_newstate(lua_Alloc f, void *ud) |
diff --git a/src/lj_trace.c b/src/lj_trace.c index 7bb6c8ae..f386b95e 100644 --- a/src/lj_trace.c +++ b/src/lj_trace.c | |||
@@ -618,6 +618,7 @@ static TValue *trace_state(lua_State *L, lua_CFunction dummy, void *ud) | |||
618 | } | 618 | } |
619 | lj_opt_split(J); | 619 | lj_opt_split(J); |
620 | lj_opt_sink(J); | 620 | lj_opt_sink(J); |
621 | if (!J->loopref) J->cur.snap[J->cur.nsnap-1].count = SNAPCOUNT_DONE; | ||
621 | J->state = LJ_TRACE_ASM; | 622 | J->state = LJ_TRACE_ASM; |
622 | break; | 623 | break; |
623 | 624 | ||