Skip to content

Commit

Permalink
heap scan simplification
Browse files Browse the repository at this point in the history
  • Loading branch information
reginaldford committed Oct 26, 2024
1 parent 554aa00 commit 41d5d12
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
5 changes: 0 additions & 5 deletions src/main/memory/sm_gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/memory/sm_heap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41d5d12

Please sign in to comment.