summaryrefslogtreecommitdiff
path: root/src/lj_gc.c
diff options
context:
space:
mode:
authorMike Pall <mike>2010-03-15 23:29:10 +0100
committerMike Pall <mike>2010-03-15 23:29:10 +0100
commit37a3ca330fca12a9f939f923c5d590410e5d9f11 (patch)
tree0fac600c9cc04c6c50ce10224e29a15b358a82fc /src/lj_gc.c
parent1fea5cb822a4da746005e0cec35fc2fe2ed5880f (diff)
downloadluajit2-37a3ca330fca12a9f939f923c5d590410e5d9f11.tar.gz
Reorder various structs to reduce padding (thanks to /usr/bin/pahole).
Diffstat (limited to 'src/lj_gc.c')
-rw-r--r--src/lj_gc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lj_gc.c b/src/lj_gc.c
index 276cd4da..d38238dd 100644
--- a/src/lj_gc.c
+++ b/src/lj_gc.c
@@ -540,7 +540,7 @@ static void atomic(global_State *g, lua_State *L)
/* Prepare for sweep phase. */
g->gc.currentwhite = cast_byte(otherwhite(g)); /* Flip current white. */
g->gc.sweepstr = 0;
- g->gc.sweep = &g->gc.root;
+ setmref(g->gc.sweep, &g->gc.root);
g->gc.state = GCSsweepstring;
g->gc.estimate = g->gc.total - (MSize)udsize; /* Initial estimate. */
}
@@ -569,8 +569,8 @@ static size_t gc_onestep(lua_State *L)
}
case GCSsweep: {
MSize old = g->gc.total;
- g->gc.sweep = gc_sweep(g, g->gc.sweep, GCSWEEPMAX); /* Partial sweep. */
- if (gcref(*g->gc.sweep) == NULL) {
+ setmref(g->gc.sweep, gc_sweep(g, mref(g->gc.sweep, GCRef), GCSWEEPMAX));
+ if (gcref(*mref(g->gc.sweep, GCRef)) == NULL) {
gc_shrink(g, L);
g->gc.state = GCSfinalize; /* End of sweep phase. */
}
@@ -649,7 +649,7 @@ void lj_gc_fullgc(lua_State *L)
setvmstate(g, GC);
if (g->gc.state <= GCSpropagate) { /* Caught somewhere in the middle. */
g->gc.sweepstr = 0;
- g->gc.sweep = &g->gc.root; /* Sweep everything (preserving it). */
+ setmref(g->gc.sweep, &g->gc.root); /* Sweep everything (preserving it). */
setgcrefnull(g->gc.gray); /* Reset lists from partial propagation. */
setgcrefnull(g->gc.grayagain);
setgcrefnull(g->gc.weak);