Andy Wingo <[EMAIL PROTECTED]> writes:

> Hi,
> 
> On Mon, 2006-05-08 at 00:29 +0300, Marius Vollmer wrote:
> > 137c137
> > < #define CELL_P(x)  (SCM_ITAG3 (x) == scm_tc3_cons)
> > ---
> > > #define CELL_P(x)  ((SCM_UNPACK(x) & (sizeof(scm_t_cell)-1)) == 
> > > scm_tc3_cons)
> 
> I don't really understand how the region can give you unaligned
> pointers, but I do confirm that this patch allows me to build guile.

Excellent!

Here is what is going on: the CELL_P predicate is used during the
conservative scanning of the GC to decide whether a random word can
possibly be a non-immediate SCM value.  Non-immediate values are the
ones that point into the heap.  The type tag for such a non-immediate
value is "lower three bits zero".  On 32-bit architectures, a cell is
8 bytes, which means that a non-immediate value is always aligned to a
cell.  On 64-bit machines, a cell is 16 bytes, and that means that a
word with "lower three bits zero" can still be invalid because it
points into the middle of a cell.

(We have similar check already for double-cells, which are 16 bytes on
32-bit machines.)

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


_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/guile-devel

Reply via email to