This is the mail archive of the guile@sourceware.cygnus.com mailing list for the Guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: gc.c question


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]