Skip to content

Commit 9642337

Browse files
ckoparkarulysses4ever
authored andcommitted
RTS: don't call GC methods in gib_exit in pointer mode
1 parent bb8ab01 commit 9642337

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

gibbon-rts/rts-c/gibbon_rts.c

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2022,25 +2022,26 @@ int gib_init(int argc, char **argv)
20222022
// Called from gib_main_expr.
20232023
int gib_exit(void)
20242024
{
2025-
GibNursery *nursery = DEFAULT_NURSERY;
2026-
GibShadowstack *rstack = DEFAULT_READ_SHADOWSTACK;
2027-
GibShadowstack *wstack = DEFAULT_WRITE_SHADOWSTACK;
2028-
GibOldgen *oldgen = DEFAULT_GENERATION;
2025+
gib_free(gib_global_bench_prog_param);
2026+
2027+
#ifndef _GIBBON_POINTER
20292028

20302029
#ifdef _GIBBON_GCSTATS
20312030
// Print GC statistics.
20322031
gib_gc_stats_print(GC_STATS);
20332032
#endif
20342033

2034+
GibNursery *nursery = DEFAULT_NURSERY;
2035+
GibShadowstack *rstack = DEFAULT_READ_SHADOWSTACK;
2036+
GibShadowstack *wstack = DEFAULT_WRITE_SHADOWSTACK;
2037+
GibOldgen *oldgen = DEFAULT_GENERATION;
20352038

20362039
// Free all objects initialized by the Rust RTS.
2037-
gib_free(gib_global_bench_prog_param);
20382040
gib_gc_cleanup(rstack, wstack, nursery, oldgen);
2039-
2040-
#ifndef _GIBBON_POINTER
20412041
// Next, free all objects initialized by the C RTS.
20422042
gib_storage_free();
2043-
#endif
2043+
2044+
#endif // ifndef _GIBBON_POINTER
20442045

20452046
// gib_free_symtable();
20462047

0 commit comments

Comments
 (0)