diff --git a/src/main/memory/sm_gc.c b/src/main/memory/sm_gc.c index 9471e85..ac408d8 100644 --- a/src/main/memory/sm_gc.c +++ b/src/main/memory/sm_gc.c @@ -35,11 +35,6 @@ sm_object *sm_move_to_new_heap(sm_heap *dest, sm_object *obj) { // Overwrite the old object. sm_pointer objects intptr_t endPoint = (intptr_t)obj + sizeOfObj; sm_new_pointer(dest, obj, new_obj); - obj = (sm_object *)((intptr_t)obj + sizeof(sm_pointer)); - while ((intptr_t)obj < endPoint) { - sm_new_pointer(dest, obj, (sm_object *)sms_false); - obj = (sm_object *)((intptr_t)obj + sizeof(sm_pointer)); - } return new_obj; } diff --git a/src/main/memory/sm_heap.c b/src/main/memory/sm_heap.c index 071c0a1..d7d9073 100644 --- a/src/main/memory/sm_heap.c +++ b/src/main/memory/sm_heap.c @@ -191,7 +191,7 @@ void sm_swap_heaps(sm_heap **a, sm_heap **b) { // Scan the heap and generate the bitmap. Return true on success. bool sm_heap_scan(sm_heap *h) { - sm_object *obj = (sm_object *)((intptr_t)h->storage); + sm_object *obj = (sm_object *)h->storage; sm_object *prev_obj = NULL; // Initialize prev_obj to track the previous object while ((char *)obj < h->storage + h->used) { // Register in heap map if it has valid object size