summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-06-16 06:50:23 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-06-16 06:50:23 -0700
commit73cc669cc401be80d323864b7591a79cda8f5ff7 (patch)
treeec23b93544b7f95c148bd110c7fd1bd62ec3040f /gc.c
parent75e89c5bcb659dd2b0cf0888b4e3b165f63376cc (diff)
downloadtxr-73cc669cc401be80d323864b7591a79cda8f5ff7.tar.gz
txr-73cc669cc401be80d323864b7591a79cda8f5ff7.tar.bz2
txr-73cc669cc401be80d323864b7591a79cda8f5ff7.zip
Remove more vestiges of the mark_makefresh hack.
* gc.c (sweep_one): Don't check for gen == -1; no reachable object can have that at this stage, since mark flips -1 objects to gen 0. (sweep): Do not clear freshobj_idx here; completely revert the mark_markfresh code. (gc): Clear freshobj_idx here., as before the mark_makefresh hack.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c19
1 files changed, 3 insertions, 16 deletions
diff --git a/gc.c b/gc.c
index 44ec51a9..a06e7d57 100644
--- a/gc.c
+++ b/gc.c
@@ -487,17 +487,7 @@ static int sweep_one(obj_t *block)
if (block->t.type & REACHABLE) {
#if CONFIG_GEN_GC
- if (block->t.gen == -1) {
- block->t.gen = 0;
- if (freshobj_idx < FRESHOBJ_VEC_SIZE)
- freshobj[freshobj_idx++] = block;
- /* If freshobj is full, it doesn't matter the next make_obj
- call will find this situation and set the full_gc flag,
- and the subsequent full_gc will take care of all
- these objects. */
- } else {
- block->t.gen = 1;
- }
+ block->t.gen = 1;
#endif
block->t.type = convert(type_t, block->t.type & ~REACHABLE);
return 0;
@@ -558,13 +548,10 @@ static int_ptr_t sweep(void)
#if CONFIG_GEN_GC
if (!full_gc) {
int i;
- int limit = freshobj_idx;
-
- freshobj_idx = 0; /* sweep_one rebuilds freshobj array */
/* No need to mark block defined via Valgrind API; everything
in the freshobj is an allocated node! */
- for (i = 0; i < limit; i++)
+ for (i = 0; i < freshobj_idx; i++)
free_count += sweep_one(freshobj[i]);
/* Generation 1 objects that were indicated for dangerous
@@ -576,7 +563,6 @@ static int_ptr_t sweep(void)
return free_count;
}
- freshobj_idx = 0;
#endif
for (heap = heap_list; heap != 0; heap = heap->next) {
@@ -708,6 +694,7 @@ void gc(void)
#if CONFIG_GEN_GC
checkobj_idx = 0;
mutobj_idx = 0;
+ freshobj_idx = 0;
full_gc = full_gc_next_time;
#endif
call_finals();