How Garbage Collector works?
Leandro Lucarella
luca at llucax.com.ar
Thu Aug 12 07:07:51 PDT 2010
Borneq, el 12 de agosto a las 11:44 me escribiste:
> Użytkownik "Lars T. Kyllingstad" <public at kyllingen.NOSPAMnet>
> napisał w wiadomości news:i40dhi$55q$1 at digitalmars.com...
> >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();
>
> How compute startOfBlock ? GC keep startOfBlock for each pointer
> (pointer consits of actual pointer and pointer to startOfBlock)?
> or search for pointer such Block that pointer betwen
> startOfBlock..startOfBlock + blockLength ?
You might find this blog posts interesting, they explain in relative
detail how the D's GC works:
http://www.llucax.com.ar/blog/blog/tag/understanding%20the%20current%20gc
(you probably want to read it in reverse order :)
--
Leandro Lucarella (AKA luca) http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Qué sabía Galileo de astronomía, Mendieta! Lo que pasa es que en este
país habla cualquiera.
-- Inodoro Pereyra
More information about the Digitalmars-d
mailing list