summaryrefslogtreecommitdiff
path: root/libguile/struct.c
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2010-01-23 16:39:14 +0100
committerLudovic Courtès <ludo@gnu.org>2010-01-23 16:39:14 +0100
commit01e74380f6170b5cb1105e5df9a368ab257420ef (patch)
tree94101bb576ec396feb39fe76b172795c0631c9c1 /libguile/struct.c
parentaa42c03669df8acf997d3108f08ce94d5d7611c2 (diff)
downloadguile-01e74380f6170b5cb1105e5df9a368ab257420ef.tar.gz
Clarify GC-registered displacements for structs.
* libguile/struct.c (scm_init_struct): Remove unneeded `GC_REGISTER_DISPLACEMENT ()' call. Comment the remaining one.
Diffstat (limited to 'libguile/struct.c')
-rw-r--r--libguile/struct.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libguile/struct.c b/libguile/struct.c
index adebe6f9f..5b748095e 100644
--- a/libguile/struct.c
+++ b/libguile/struct.c
@@ -992,9 +992,10 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate)
void
scm_init_struct ()
{
- 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);
scm_struct_table = scm_make_weak_key_hash_table (scm_from_int (31));
required_vtable_fields = scm_from_locale_string (SCM_VTABLE_BASE_LAYOUT);