On 16 Aug 2005, at 18:14, Yuval Kogman wrote:
On Mon, Aug 15, 2005 at 15:59:34 +0100, Adrian Howard wrote:
I'm not sure what you're proposing here. A separate arena for
stuff  you want to allocate and not be moved by the GC? How would
I tell the  compiler?

You won't, the language glue is responsible for setting that up for
you, and it does that by assuming it's always there, and the
compiler simply optimizes the cases where it's never going to be
needed.

Sorry - I don't understand. If I do:

    call_to_external_c_library_foo( $foo );
    call_to_external_c_library_bar( $bar );

Then how does the compiler know that $foo is only used temporarily and can be moved around, while $bar is cached in the external library and shouldn't be moved by any heap de-fragmentation that the garbage collector might do?

How about

     do : GC::priority(:new) {
         # only GC things allocated during the lifetime
         # of the block
     }

I think that's not "priority" but "limit" or "scoped" or
"origin(:local)" or something like that...
[reasonable sounding terms snipped]

Sounds nice :-)

Actually, since to my naive eyes it looks like the GC is a first
class object the problem can probably be solver better by adding
your  own.

Well, as I see it the GC is a subobject of the runtime. The amount
of control that this object can give you can be checked using the
strong support for reflection that perl 6 will have, or by simply
asking the runtime to switch GC (if it lets you do that).

Nice.

Thanks for answering my mad ramblings :-)

Cheers,

Adrian

Reply via email to