all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alin Soare <as1789@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Andreas Schwab <schwab@linux-m68k.org>, emacs-devel@gnu.org
Subject: Re: please help about the implementation of GC.
Date: Sun, 30 Oct 2011 20:27:33 +0200	[thread overview]
Message-ID: <CA+Xtq3UNUQ+-KErX09oprg=h=9B+131-T0AVezEViuOZS1_ENg@mail.gmail.com> (raw)
In-Reply-To: <838vo28ix9.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1012 bytes --]

> > > I wish to read the algorithm of gc, and I cannot.
> >
> > The Emacs gc is a simple mark and sweep collector.
>
> Right.
>
> Alin, you can start by reading the node "Garbage Collection" in the
> ELisp manual, and then proceed reading alloc.c, where you will see
> many functions named mark_SOMETHING and then gc_sweep that does the
> sweep stage.  If you want more background before reading the ELisp
> manual, try googling "mark and sweep garbage collection".
>

I have read the mark-sweep algorithm; I know it. However, I do not manage
making the connection with alloc.c.

For example, I cannot understand what kind of objects are kept in every
node of the red-black tree  (in books I never saw gc implemented with
red-black trees). I know that the objects are kept in obarrays. What link
is there between obarrays and red-black tree of gc ?

What happens to a Lisp_Object defined in C code? Is it freed if it is found
by conservative stack algorithm ? What is the link between GCPRO? macros
and the gc ?

[-- Attachment #2: Type: text/html, Size: 1324 bytes --]

  reply	other threads:[~2011-10-30 18:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-30 14:01 please help about the implementation of GC Alin Soare
2011-10-30 16:56 ` Andreas Schwab
2011-10-30 17:53   ` Eli Zaretskii
2011-10-30 18:27     ` Alin Soare [this message]
2011-10-30 18:43       ` Andreas Schwab
2011-10-30 22:05       ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to='CA+Xtq3UNUQ+-KErX09oprg=h=9B+131-T0AVezEViuOZS1_ENg@mail.gmail.com' \
    --to=as1789@gmail.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=schwab@linux-m68k.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.