On Thu, 12 Aug 2010 10:44:51 +0200, Borneq wrote:
> Użytkownik "Nick Sabalausky" <[email protected]> napisał w wiadomości
> news:[email protected]...
>> The GC keeps track of the starting address and the length of each
>> allocation.
>
> How to deal with:
> 1.alloc 1000 bytes to pointer
> 2.increment pointer by 500 bytes
> 3.checking if block 1000 bytes is reachable but only pointer is in roots
Since the GC keeps track of the length of the memory block, it can also
tell whether the pointer is inside the memory block.
if (pointer >= startOfBlock && pointer < startOfBlock + blockLength)
doNotCollect();
-Lars