unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Marius Vollmer <mvo@zagadka.ping.de>
Cc: Lynn Winebarger <owinebar@free-expression.org>
Subject: Re: Latent bugs?
Date: 28 Dec 2002 20:22:57 +0100	[thread overview]
Message-ID: <87k7huaqy6.fsf@zagadka.ping.de> (raw)
In-Reply-To: <m3isxeousz.fsf@lumo.pacujo.net>

Marko Rauhamaa <marko@pacujo.net> writes:

> The Guile manual doesn't state that basically all writable memory of
> a process participates in GC:

Hmm.  More needs to be said to get a accurate picture of how GC works
in Guile.

The Guile GC does only manage objects that are represented as a value
of type SCM.  All these objects are either immediate (and thus don't
need to be freed), or they consist of at least a header cell.  Thus,
one can say that the Guile GC only manages these header cells.  A
string, for example, consists of one such header cell and the memory
to hold the characters.  When a string is freed, the cell and the
additional memory is freed together.

Now, to do its thing, the GC needs to find all references between life
objects, and also needs to know about the root set of references.  The
root references can either be known precisely (protecting a object via
scm_gc_protect_object creates such a known, precise root reference) or
they can be searched for in a specified memory region.  During this
search, all words are considered and when the bit pattern can be
interpreted as a SCM reference, it is assumed to actually be one.

When you say that "basically all writable memory of a process
participates in GC", you probably mean that all writable memory of a
process is taken to be in the root set, and is searched for potential
references.  This is not true.  Only the stacks (of all threads) and
the registers are searched in this manner.  The global heap is not
searched.

The GC algorithm has changed somewhat in the recent past, but the
behavior re where root references are found has not been changed.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


_______________________________________________
Bug-guile mailing list
Bug-guile@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-guile


      reply	other threads:[~2002-12-28 19:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-28  8:49 Latent bugs? Marko Rauhamaa
2002-12-28  9:30 ` Lynn Winebarger
2002-12-28 18:35   ` Marko Rauhamaa
2002-12-28 19:22     ` Marius Vollmer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k7huaqy6.fsf@zagadka.ping.de \
    --to=mvo@zagadka.ping.de \
    --cc=owinebar@free-expression.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).