diff options
Diffstat (limited to 'src/bootstrap/gc.c')
-rw-r--r-- | src/bootstrap/gc.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/bootstrap/gc.c b/src/bootstrap/gc.c index a72f718..48499ac 100644 --- a/src/bootstrap/gc.c +++ b/src/bootstrap/gc.c | |||
@@ -121,17 +121,9 @@ mark_and_sweep(void) { | |||
121 | if (!obj->marked) { | 121 | if (!obj->marked) { |
122 | // Free heap allocated memory for this object if needed. | 122 | // Free heap allocated memory for this object if needed. |
123 | if (obj->type == OBJ_TYPE_SYMBOL) { | 123 | if (obj->type == OBJ_TYPE_SYMBOL) { |
124 | if (obj->symbol != NULL) { | 124 | array_free(obj->symbol); |
125 | free(obj->symbol); | ||
126 | } | ||
127 | obj->symbol = NULL; | ||
128 | obj->symbol_n = 0; | ||
129 | } else if (obj->type == OBJ_TYPE_STRING) { | 125 | } else if (obj->type == OBJ_TYPE_STRING) { |
130 | if (obj->symbol != NULL) { | 126 | array_free(obj->string); |
131 | free(obj->string); | ||
132 | } | ||
133 | obj->string = NULL; | ||
134 | obj->string_n = 0; | ||
135 | } | 127 | } |
136 | gc.free_objects.buf[gc.free_objects.size++] = i; | 128 | gc.free_objects.buf[gc.free_objects.size++] = i; |
137 | } | 129 | } |