On Mon, 15 Aug 2005 12:40:05 +0100, Adrian Howard <[EMAIL PROTECTED]> wrote:
> 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:

Stealing usefull things from other langagues is good.

> 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.

I think that the FFI would take care of that via handels.

[...]

> 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:

Part of that is why we have the GC::tardy traint and C<no GC::delay>.
But C<no GC::destroy> preventing the desctruction of objects in its
lexical scope.

[...]

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

I have strongly thought about adding weakrefs into the API.  However I
recall $larry basically saying the need for weak refs means you have
got your design wrong.  However google doesn't seem to find it.
Unless I hear words otherwise I'll add it in the next revision.

> 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).

Not all GC's have before and after concepts.  (pure refcounting and
mulithreaded models for example). I think that these hooks would be
added via the object interface.

> Hopefully this makes some vague sort of sense.

Thankyou it was helpfull.

-- 
Please excuse my spelling as I suffer from agraphia. See
http://dformosa.zeta.org.au/~dformosa/Spelling.html to find out more.
Free the Memes.

Reply via email to