This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: gc.c question
- To: Han-Wen Nienhuys <hanwen at cs dot uu dot nl>
- Subject: Re: gc.c question
- From: Dirk Herrmann <dirk at ida dot ing dot tu-bs dot de>
- Date: Mon, 29 May 2000 13:14:27 +0200 (MEST)
- cc: guile at sourceware dot cygnus dot com
On Mon, 29 May 2000, Han-Wen Nienhuys wrote:
> I was looking over gc.c yesterday, and I don't get it: what is the
> difference between SCM_GCMARKP() and SCM_GC8MARKP ()?
The difference is that SCM_GCMARKP checks the CDR cell element, while
GC8MARKP checks the CAR cell element. Since gc runs over a large number
of cells, the effort per cell has to be minimized. Since for some scheme
type only either SCM_GCMARKP or SCM_GC8MARKP has to be checked, this check
is postponed to a point where the cell type is known.
Your solution would be a performance improvement for the case that it is
very probable to detect an already marked cell during gc. Then, your
solution would return quicker, because the type dispatch would be
avoided. All that I have heard is, that _most_ cells are only pointed at
by one single cell, i. e. it is comparably unlikely to detect an already
marked cell. This is all statistics, though and may differ for a certain
application. (And I have never checked it for myself).
Best regards
Dirk