summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-11 12:28:18 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-11 12:28:18 -0700
commitdb3011bf955768f3f0a9411b2f9782b1290c950d (patch)
tree556a1c8574cb7d0bb86a42a0478a54aaad3c49f5 /gc.c
parent3cffd5639fc0d1484a543c0bc137b8e00205a9e9 (diff)
downloadtxr-db3011bf955768f3f0a9411b2f9782b1290c950d.tar.gz
txr-db3011bf955768f3f0a9411b2f9782b1290c950d.tar.bz2
txr-db3011bf955768f3f0a9411b2f9782b1290c950d.zip
gc: sys:gc function must not reset full_gc flag.
* gc.c (gc_wrap): We must not set full_gc according to the argument, but only set it to 1 if the argument requests full GC. full_gc is set to 1 for some reason having to do with correctness; only the garbage collector can reset full_gc back to 0, otherwise incorrect behavior will ensue.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index f3ce3275..c2a4f657 100644
--- a/gc.c
+++ b/gc.c
@@ -974,7 +974,8 @@ static val gc_wrap(val full)
{
if (gc_enabled) {
#if CONFIG_GEN_GC
- full_gc = !null_or_missing_p(full);
+ if (!null_or_missing_p(full))
+ full_gc = 1;
#endif
gc();
return t;