summaryrefslogtreecommitdiff
path: root/libguile/struct.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-01-25 23:41:27 +0100
committerLudovic Courtès <ludo@gnu.org>2010-01-25 23:41:27 +0100
commit227eff6a77dd58d64775fe91ae0f1596bfe3371b (patch)
tree5ad708807eb92ed6c7185ede075cb97438027add /libguile/struct.c
parentd31b95195168ded0d3300159403adb2c4917e291 (diff)
Reinstate 2-word displacement for structs.
* libguile/struct.c (scm_init_struct): Reinstate 2-word displacement removed by 01e74380f6170b5cb1105e5df9a368ab257420ef.
Diffstat (limited to 'libguile/struct.c')
-rw-r--r--libguile/struct.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libguile/struct.c b/libguile/struct.c
index 6340a700c..4a9455517 100644
--- a/libguile/struct.c
+++ b/libguile/struct.c
@@ -997,6 +997,11 @@ scm_init_struct ()
default. */
GC_REGISTER_DISPLACEMENT (2 * sizeof (scm_t_bits) + scm_tc3_struct);
+ /* In the general case, `SCM_STRUCT_DATA (obj)' points 2 words after the
+ beginning of a GC-allocated region; that region is different from that of
+ OBJ once OBJ has undergone class redefinition. */
+ GC_REGISTER_DISPLACEMENT (2 * sizeof (scm_t_bits));
+
scm_struct_table = scm_make_weak_key_hash_table (scm_from_int (31));
required_vtable_fields = scm_from_locale_string (SCM_VTABLE_BASE_LAYOUT);
required_applicable_fields = scm_from_locale_string (SCM_APPLICABLE_BASE_LAYOUT);