This is the mail archive of the
mailing list for the Guile project.
Re: GUILE's GC - why we struggling to solve already solved problems ? (was Re: finding the top of the stack in linux)
17-Jul-00 19:05 you wrote:
> email@example.com writes:
>> If you have access to such pointer then probably you can access to main() as
>> well. For true embeddable language it's important to work with EXISTING
>> binary-only interface (like apache modules interface).
> I can't imagine that the Apache team would not be willing to add
> something as harmless as get_stack_pointer() call to the interface.
Perhaps if you'll spend half-year arguing with Apache-team they will add such
"stupid" call to the API. Now multiply on number of projects out there.
>> But why the hell we
>> are inventing our own GC with a lot of limitations and not even using clearly
>> appropriate parts (like stack placement finding subroitine) from ALREADY
>> existing and TESTED solutions. Why to reinvent the wheel ? What's
> Have you even looked at the current garbage collection?
I tried. As with GUILE as whole biggest problem is just lack of documentation.
> How do you propose to make Boehm's GC jibe with applications that do
> part of the allocations themselves?
1. Just allow such applications use normal malloc (Boehm's GC is not
intrusive: you can safely mix allocations with malloc and GC_MALLOC).
2. Preload it in "malloc replacement mode". Then malloc() will be
GC_MALLOC() and free will be NOP.
> Does Apache use Boehm's GC for example?
What for ? Apache is using memory pools for itself so it does not need
GC. You can use malloc, Boehm's GC, etc in modules of course (if you wish).
> How do you do handle weak vectors?
Huh ? What's weak vectors ? With Boehm's GC you can easily create weak
references: allocate memory with GC_MALLOC_ATOMIC (so object's body will not
be scanned for pointers) and then use GC_general_register_disappearing_link
to mark pointer as weak reference (when object will be collected pointer
to some object field will be nullified).
P.S. There are exist "typed" objects concept as well so if you need weak
pointer and non-weak pointer in one object you are not forced to use