[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guile + Boehm GC: First Remarks
From: |
Ludovic Courtès |
Subject: |
Re: Guile + Boehm GC: First Remarks |
Date: |
Fri, 02 Jun 2006 14:41:44 +0200 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux) |
Hi,
Neil Jerram <address@hidden> writes:
> address@hidden (Ludovic Courtès) writes:
>
>> unless otherwise specified, every register and every piece of memory
>> is scanned for pointers, not only the heap (however, only heap
>> regions allocated via the GC allocation routines are scanned).
>
> I wonder if this is the main cause of BGC not performing as well as
> Guile's own GC?
BGC ends up scanning more memory than Guile, of course. However...
> Guile's own GC knows, for example, that there's no
> point scanning the characters of a string, or the elements of a
> uniform vector, and that SMOB memory looks after itself. Does BGC
> give us any way to feed this kind of information in, so that BGC could
> avoid such scans in the same way Guile's GC does?
... As explained in my original post, BGC provides a function to
allocate memory that must _not_ be scanned (namely `GC_MALLOC_ATOMIC').
In my post, I mentioned that I wrapped this feature in
`scm_gc_malloc_pointerless ()' so that one can use it, for instance, to
allocate stringbufs.
BGC also allows one to describe more complex "scanning" patterns. For
instance, in order to implement weak-car pairs, one has to tell BGC to
not scan the first word of the pair (since otherwise the object pointed
to by the car would always remain unreachable).
But please, relax about performance, we still haven't run any meaningful
benchmark. ;-)
Thanks,
Ludovic.