guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: GC ??


From: Matthias Koeppe
Subject: Re: GC ??
Date: Wed, 03 Dec 2003 18:08:27 +0100
User-agent: Gnus/5.090024 (Oort Gnus v0.24) Emacs/21.3.50 (usg-unix-v)

address@hidden writes:

> + There would be 3 heaps for program that we write
>   a. C heap
>   b. C/Scheme heap
>   c. Scheme heap.
> + The C heap would not be traced by GC.
> + It is in the Scheme heap GC is going to trace.
>
> What is C/S heap for?

I wrote "C/Scheme _stack_".  The C and the Scheme side use the same
stack.  This is where nested function calls etc. are recorded.

The Scheme objects are all stored in the Scheme heap.  But pointers to
Scheme objects can live in all three memory regions.

When we say that the GC scans a memory region, it means that it scans
it for pointers to live Scheme objects.  This is also referred to as
the "marking phase" of GC.  After marking all live objects, the GC can
collect (delete) all unmarked objects.

> Andreas told about the function 'scm_permanent_object'.
> Given an SCM object to this function where would it
> get stored? Would the given value never be reached by
> GC or it would be skipped by GC?

As far as I know, scm_permanent_object simply registers its argument
as another root from which the recursive marking procedure is started.

> [about guardians]

I have never used guardians, so I can't help here.

-- 
Matthias Koeppe -- http://www.math.uni-magdeburg.de/~mkoeppe
SWIG makes Guile wrappers for C/C++ libs -- http://www.swig.org
ILISP does module-aware Emacs/Guile interaction -- http://sf.net/projects/ilisp




reply via email to

[Prev in Thread] Current Thread [Next in Thread]