aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-12-17 12:57:53 +0000
committerMichael Williamson <mike@zwobble.org>2023-12-17 12:57:53 +0000
commitd51f80a5bd21c4dd6cac8d623e96d1093dc1deff (patch)
tree4d84abd62f071da1ac8ce6ee785990c4ccd28865 /runtime
parentc3e4f46095658fdf331046e5812bc135e66f4844 (diff)
Remove GC perm roots
Diffstat (limited to 'runtime')
-rw-r--r--runtime/src/gc.c22
1 files changed, 0 insertions, 22 deletions
diff --git a/runtime/src/gc.c b/runtime/src/gc.c
index c5738f63..dc8c719b 100644
--- a/runtime/src/gc.c
+++ b/runtime/src/gc.c
@@ -49,8 +49,6 @@ void mark(struct ShedGcObjectHeader* object) {
// == Roots ==
-// === Root stack ===
-
typedef size_t ShedGcRootIndex;
ShedGcRootIndex gc_root_stack_index = 0;
@@ -78,22 +76,6 @@ void shed__runtime__gc_push_root(ShedObject gc_root) {
shed__runtime__gc_push_root_gc_object((struct ShedGcObjectHeader*) gc_root);
}
-// === Perm roots ===
-
-ShedGcRootIndex gc_perm_root_index = 0;
-
-// TODO: should be growable
-struct ShedGcObjectHeader* gc_perm_roots[16384];
-
-void shed__runtime__gc_add_perm_root(ShedObject gc_root) {
- if (!is_gc_object(gc_root)) {
- return;
- }
-
- gc_perm_roots[gc_perm_root_index] = (struct ShedGcObjectHeader*) gc_root;
- gc_perm_root_index++;
-}
-
// == Allocation ==
struct ShedGcObjectHeader* first = NULL;
@@ -125,10 +107,6 @@ void* shed__runtime__gc_alloc(size_t size, size_t children_offset, size_t childr
// == Collection ==
void mark_reachable() {
- for (size_t i = 0; i < gc_perm_root_index; i++) {
- mark(gc_perm_roots[i]);
- }
-
for (size_t i = 0; i < gc_root_stack_index; i++) {
mark(gc_root_stack[i]);
}