Use Box instead of NonNull to clarify ownership of the list of allocations #107
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This made it possible to remove several sections of
unsafe
code. I also eliminated the temporaryVec
used to store the unmarked nodes; instead, they are stored in a linked list built from theGcBox.header.next
pointers.There were a few additional things I removed from the mark-and-sweep code, but I wasn't sure why they were there in the first place:
mark()
pass after finalizing all the unmarked objects. I can't see how the set of marked objects would change after the first pass, and if they do, then the new garbage nodes are ignored anyways. It seems quite expensive anyways to traverse the reference graph twice.false
since all nodes are unmarked whenmark()
finishes.