summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-01-09 14:48:49 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-01-09 14:48:49 -0800
commitfdf67dae2092e0d6fe460e16a939080493e00a3b (patch)
treea1add49a5b40283cb2ae2f2a75d2bf46dd36edf9 /gc.c
parent3aa731546c4691fac333846f15950578425f43da (diff)
downloadtxr-fdf67dae2092e0d6fe460e16a939080493e00a3b.tar.gz
txr-fdf67dae2092e0d6fe460e16a939080493e00a3b.tar.bz2
txr-fdf67dae2092e0d6fe460e16a939080493e00a3b.zip
gc: consolidate top-of-stack and context handling.
* gc.c (mark): Eliminate mach_context_t * argument; just gc_stack_top is passed. (gc): Specify the base address of the machine context as the top of the stack. Still, on aarch64, STACK_TOP_EXTRA_WORDS is required, otherwise we get prematurely freed objects.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/gc.c b/gc.c
index 84fd5b3a..3029158c 100644
--- a/gc.c
+++ b/gc.c
@@ -494,7 +494,7 @@ static void mark_mem_region(val *low, val *high)
mark_obj_maybe(*low);
}
-static void mark(mach_context_t *pmc, val *gc_stack_top)
+static void mark(val *gc_stack_top)
{
val **rootloc;
@@ -519,11 +519,6 @@ static void mark(mach_context_t *pmc, val *gc_stack_top)
#endif
/*
- * Then the machine context
- */
- mark_mem_region(coerce(val *, pmc), coerce(val *, (pmc + 1)));
-
- /*
* Finally, the stack.
*/
mark_mem_region(gc_stack_top - STACK_TOP_EXTRA_WORDS, gc_stack_bottom);
@@ -794,7 +789,6 @@ static void call_finals(void)
void gc(void)
{
- val gc_stack_top = nil;
#if CONFIG_GEN_GC
int exhausted = (free_list == 0);
int full_gc_next_time = 0;
@@ -817,7 +811,7 @@ void gc(void)
gc_enabled = 0;
rcyc_empty();
iobuf_list_empty();
- mark(&mc, &gc_stack_top);
+ mark(coerce(val *, &mc));
hash_process_weak();
prepare_finals();
swept = sweep();