GC Sentinel

Leandro Lucarella llucax at gmail.com
Tue Oct 27 17:42:55 PDT 2009


dsimcha, el 27 de octubre a las 23:41 me escribiste:
> I'm looking at the GC implementation and starting my hacking.  I noticed that
> the ends of blocks are already being used in some creative ways in the
> sentinel version.  This looks like a debugging feature, though I don't
> understand it completely.  Can one of the original implementors (Walter, Sean)
> explain to me what the heck version(SENTINEL) in gcx.d does at a high level,
> whether it conflicts with storing bit masks for precise heap scanning at the
> ends of memory blocks, and whether we still even need it?

I think that's used to check for memory corruption, by storing a known
patter before and after the actual object. Then, each time you can, you
check that the unused memory block is intact (meaning nobody wrote to an
invalid memory area).

I think it would be reasonble to keep the SENTINEL version as is (without
precise scanning) since it's a debugging feature. Of course it's nice to
have things unchanged when debugging, but the SENTINEL version is already
changing *a lot* about how objects are stored, so that nice property is
gone already.

-- 
Leandro Lucarella (AKA luca)                     http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145  104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Don't take life to seriously, you won't get out alive



More information about the Digitalmars-d mailing list