Skip to content

Commit fda957e

Browse files
committed
change, better
1 parent 40ac5f5 commit fda957e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

main.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,8 @@ void sweep(VM* vm) {
117117

118118
// note: easy way to understand the above - look at the LH side.
119119
// If *object, then that is the object, an item in the graph. If **object, then that is the graph of objects.
120-
// in the first case, you're assigning the next object to the current object - meaning that the current object gets removed from the graph
121-
// in the second case, note the order: first (), then ->, then &. So: (*object) dereferences Object in graph,
122-
// (*object)->next accesses next field of Object, and &(*object)->next takes the address of the next pointer.
123-
// so object (with type **Object) now points to the address of the next pointer of the current Object.
124-
// In effect, this means it moves to the next Obect in the graph
120+
// in the first case, you're assigning the next Object to the current Object - effectively removing the current Object from the graph
121+
// in the second case, you're updating the object graph to take the address of the next Object - the graph now points to that next Object
125122

126123
void gc(VM* vm) {
127124
markALL(vm);

0 commit comments

Comments
 (0)