guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

struct displacements


From: Andy Wingo
Subject: struct displacements
Date: Sun, 24 Jan 2010 18:33:00 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux)

Hello Ludovic,

    -  GC_REGISTER_DISPLACEMENT (2*sizeof(scm_t_bits)); /* for the self data 
pointer */
    -  GC_REGISTER_DISPLACEMENT (2*sizeof(scm_t_bits)
    -                            + scm_tc3_struct); /* for the vtable data 
pointer */
    +  /* The first word of a struct is equal to `SCM_STRUCT_DATA (vtable) +
    +     scm_tc3_struct', and `SCM_STRUCT_DATA (vtable)' is 2 words after 
VTABLE by
    +     default.  */
    +  GC_REGISTER_DISPLACEMENT (2 * sizeof (scm_t_bits) + scm_tc3_struct);

I'm pretty sure the first case is still needed, for instance
reallocation. It is, as the comment indicates, "for the self data
pointer" -- the second word of the object, which normally points to the
third word of the object, but for reallocated instances points to the
third word of *another* object. See my article on redefining classes for
more info.

Can you change this?

Andy
-- 
http://wingolog.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]