summaryrefslogtreecommitdiff
path: root/libguile/weaks.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@red-bean.com>1999-06-15 14:00:11 +0000
committerJim Blandy <jimb@red-bean.com>1999-06-15 14:00:11 +0000
commit250da3691016286961cf92c0c941a292fa48d8d4 (patch)
treed8f8db4873fa357ab593b81ea05fbc5fe8ca5bec /libguile/weaks.c
parent70c4c075e33d1c1c5068677836813328a835473f (diff)
downloadguile-250da3691016286961cf92c0c941a292fa48d8d4.tar.gz
Fix from Ken Raeburn <raeburn@raeburn.org>:
* weaks.c (scm_make_weak_vector): Add another extra slot before vector contents, to be used only during garbage collection. * weaks.h (SCM_WVECT_GC_CHAIN): New macro to access it. * gc.c (scm_weak_vectors): Now a SCM instead of a SCM*, and now static. (scm_weak_size, scm_n_weak): Deleted. (scm_igc): Use SCM_WVECT_GC_CHAIN to build up a chain of weak vectors without allocating new storage during GC, using scm_weak_vectors as the head of the chain. (scm_mark_weak_vector_spines): Walk SCM_WVECT_GC_CHAIN chain instead of stepping through an array. (scm_gc_sweep): Update offset used to find start of weak vector to free it. (scm_init_storage): Set scm_weak_vectors to EOL.
Diffstat (limited to 'libguile/weaks.c')
-rw-r--r--libguile/weaks.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libguile/weaks.c b/libguile/weaks.c
index b005acc55..aaf246ded 100644
--- a/libguile/weaks.c
+++ b/libguile/weaks.c
@@ -58,11 +58,12 @@ scm_make_weak_vector (k, fill)
SCM fill;
{
SCM v;
- v = scm_make_vector (scm_sum (k, SCM_MAKINUM (1)), fill);
+ v = scm_make_vector (scm_sum (k, SCM_MAKINUM (2)), fill);
SCM_DEFER_INTS;
SCM_SETLENGTH(v, SCM_INUM (k), scm_tc7_wvect);
- SCM_VELTS(v)[0] = (SCM)0;
- SCM_SETVELTS(v, SCM_VELTS(v) + 1);
+ SCM_VELTS(v)[0] = SCM_EOL;
+ SCM_VELTS(v)[1] = (SCM)0;
+ SCM_SETVELTS(v, SCM_VELTS(v) + 2);
SCM_ALLOW_INTS;
return v;
}