summaryrefslogtreecommitdiffstats
path: root/gc.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-05-11 08:00:50 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-05-11 08:00:50 -0700
commitdce942fb5980eb7b25bd08ee7e9f5ef2f3a97ff8 (patch)
tree1c42e67cf2e414019f5f6d82111efa755194aa77 /gc.c
parent823de0fec90d40a62a573efaac074fbc72293bdd (diff)
downloadtxr-dce942fb5980eb7b25bd08ee7e9f5ef2f3a97ff8.tar.gz
txr-dce942fb5980eb7b25bd08ee7e9f5ef2f3a97ff8.tar.bz2
txr-dce942fb5980eb7b25bd08ee7e9f5ef2f3a97ff8.zip
android: restore pointer tag in gc_free_all.
* gc.c (gc_free_all): Just like we do in the sweep function, we must mask back the pointer tag that we removed from the heap object's pointer, before handing the pointer to the free function. Starting in Android 11, the pointer tagging is more strict. It was not enforced previously; now our logic for stripping and restoring the tags is actualy being tested.
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gc.c b/gc.c
index 5fbf5c88..45106d8b 100644
--- a/gc.c
+++ b/gc.c
@@ -1279,7 +1279,11 @@ void gc_free_all(void)
finalize(block);
}
+#if CONFIG_NAN_BOXING_STRIP_TAG
+ free(coerce(heap_t *, coerce(ucnum, iter) | (iter->tag << TAG_BIGSHIFT)));
+#else
free(iter);
+#endif
iter = next;
}
}