1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-16 00:30:21 +02:00

Allocate data for structures on an eight-byte boundary, as

required by the tagging system.
* struct.c (alloc_struct): New function.
(scm_make_struct, scm_make_vtable_vtable): Call it.
* struct.h (scm_struct_n_extra_words): Bump to 3.
(scm_struct_i_ptr): New "field".
* gc.c (scm_gc_sweep): When we need to free the data, use the
information stored by alloc_struct to find the beginning of the
block allocated to the structure, so we can free it.
This commit is contained in:
Jim Blandy 1996-10-15 00:10:59 +00:00
parent 2dfc85c018
commit 14d1400fa7
3 changed files with 74 additions and 29 deletions

View file

@ -49,9 +49,10 @@
/* Number of words with negative index */
#define scm_struct_n_extra_words 2
#define scm_struct_n_extra_words 3
/* These are how the initial words of a vtable are allocated. */
#define scm_struct_i_ptr -3 /* start of block (see alloc_struct) */
#define scm_struct_i_n_words -2 /* How many words allocated to this struct? */
#define scm_struct_i_tag -1 /* A unique tag for this type.. */
#define scm_struct_i_layout 0 /* A symbol describing the physical arrangement of this type. */