GC encapsulation

chromatic chromatic at wgz.org
Thu Jan 7 00:57:31 UTC 2010


On Wednesday 06 January 2010 at 13:44, Vasily Chekalkin wrote:

> Hello.
> 
> After recent play with Boehm GC and Parrot's GC I have next "roadmap" 
> for properly encapsulate GC in Parrot. It will give us ability to 
> implement almost any kind of GC without reworking all things.
> 
> 1. Extend GC_Subsystem struct with next functions:
>    a) allocate_pmc_header(flags)
>    b) allocate_string_header(flags?)
>    c) allocate_attributes(pmc_enum)
>    d) allocate_raw_buffer - to allocate buffer without pointers. Useful 
> for Strings, FixedIntegerArray, etc.
>    e) allocate_buffer - buffer which can contains pointers.
> 
> 2. Change various Parrot_gc_foo functions to use it instead of 
> interp->mem_pools and remove interp->mem_pools.
> 
> 3. Change current MS GC to allocate mem_pools in 
> GC_Subsystem->gc_private attribute.
> 
> Any thought/ideas/objections? If no one will complain I'll try to 
> implement it over weekend so we can ship it with 2.0.

That all looks reasonable to me.

I suspect that eventually we can merge some of these functions (why do we need 
separate functions for PMC and STRING pools?), but first things first.

I know why we need them *now*, but in the future we might not.

-- c


More information about the parrot-dev mailing list