diff options
author | Ludovic Courtes <ludovic.courtes@laas.fr> | 2006-05-02 21:30:07 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2008-09-05 00:47:54 +0200 |
commit | 4650cdd20dd8b4931bed910e299e766f391546aa (patch) | |
tree | 57a2966e192e042cfb735fcc607bf1d515574e01 /libguile/weaks.c | |
parent | bc700b6dd35fe224a239bc27e439ec7439b6ea9c (diff) | |
download | guile-4650cdd20dd8b4931bed910e299e766f391546aa.tar.gz |
Fixed weak alist vectors by having them use weak hash tables instead.
* libguile/weaks.c (scm_make_weak_key_alist_vector): Use
`scm_make_weak_key_hash_table ()'.
(scm_make_weak_value_alist_vector): Use `scm_make_weak_value_hash_table ()'.
(scm_make_doubly_weak_alist_vector): Use `scm_make_doubly_weak_hash_table ()'.
git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-12
Diffstat (limited to 'libguile/weaks.c')
-rw-r--r-- | libguile/weaks.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libguile/weaks.c b/libguile/weaks.c index 3d684cf82..6f22f629a 100644 --- a/libguile/weaks.c +++ b/libguile/weaks.c @@ -132,6 +132,12 @@ SCM_DEFINE (scm_weak_vector_p, "weak-vector?", 1, 0, 0, The alist vector themselves are _not_ weak. The `car' (or `cdr', or both) of the pairs within it are weak. See `hashtab.c' for details. */ + +/* FIXME: We used to have two implementations of weak hash tables: the one in + here and the one in `hashtab.c'. The difference is that weak alist + vectors could be used as vectors while (weak) hash tables can't. We need + to unify that. */ + SCM_DEFINE (scm_make_weak_key_alist_vector, "make-weak-key-alist-vector", 0, 1, 0, (SCM size), "@deffnx {Scheme Procedure} make-weak-value-alist-vector size\n" @@ -144,7 +150,7 @@ SCM_DEFINE (scm_make_weak_key_alist_vector, "make-weak-key-alist-vector", 0, 1, "would modify regular hash tables. (@pxref{Hash Tables})") #define FUNC_NAME s_scm_make_weak_key_alist_vector { - return scm_make_vector (size, SCM_EOL); + return scm_make_weak_key_hash_table (size); } #undef FUNC_NAME @@ -155,7 +161,7 @@ SCM_DEFINE (scm_make_weak_value_alist_vector, "make-weak-value-alist-vector", 0, "(@pxref{Hash Tables})") #define FUNC_NAME s_scm_make_weak_value_alist_vector { - return scm_make_vector (size, SCM_EOL); + return scm_make_weak_value_hash_table (size); } #undef FUNC_NAME @@ -166,7 +172,7 @@ SCM_DEFINE (scm_make_doubly_weak_alist_vector, "make-doubly-weak-alist-vector", "buckets. (@pxref{Hash Tables})") #define FUNC_NAME s_scm_make_doubly_weak_alist_vector { - return scm_make_vector (size, SCM_EOL); + return scm_make_doubly_weak_alist_vector (size); } #undef FUNC_NAME |