Skip to content
Discussion options

You must be logged in to vote

A closer explanation why it breaks:

Objects are stored compactly on GC heap. GC scans objects one by one on the heap, and computes the location of next object simply by pPrevious + pPrevious->Length + objectHeaderSize. If you modify the length field, GC will loose the track of next object, and crash when attempting to manipulate subsequent object.

In the luckiest case, the length can happen to cover the next object exactly and direct GC to the second next object. This is totally unreliable since GC can place objects in arbitrary order onto the heap.

Replies: 4 comments 3 replies

Comment options

You must be logged in to vote
2 replies
@0UserName
Comment options

@tannergooding
Comment options

Comment options

You must be logged in to vote
1 reply
@tannergooding
Comment options

Answer selected by 0UserName
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants