On 15 Aug 2005, at 02:13, David Formosa ((aka ? the Platypus)) wrote:

After a very fruitful discussion I've rewritten my suggested GC API.
Comments please.
[snip]

I'm speaking from complete ignorance since I've only been vaguely following the subject... but four additional things that strike me as useful (because I found them so in Pop-11 when I used it) would be:

1) Some way of declaring objects as being "fixed" so we can pass them to external code without having to worry about the GC moving them around.

2) Some way of being able to tell the garbage collector to ignore the current contents of the heap for the purposes of GC. One Pop-11 idiom was to do something like:

    ;;; create a whole bunch of complicated self referencing
    ;;; objects that we know are going to persist over time

    sys_garbage();    ;;; run the garbage collector
    sys_lock_heap();  ;;; lock stuff currently in the heap

    ;;; do lots of stuff that now runs quicker since the GC doesn't
    ;;; have to worry about marking the objects that we know are
    ;;; not going away

    sys_unlock_heap();    ;;; give the GC full rein again


3) Some way of marking structures/fields so their reference doesn't count. Weakrefs basically.

4) Hooks to run code before/after GC. Occasionally very useful. (e.g. with the gc hooks and heap locking/unlocking you could implement your own ephemeral GC system in Pop-11).

Hopefully this makes some vague sort of sense.

Cheers,

Adrian

Reply via email to