1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 22:31:12 +02:00

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
This commit is contained in:
Ludovic Courtes 2006-05-02 21:30:07 +00:00 committed by Ludovic Courtès
parent bc700b6dd3
commit 4650cdd20d

View file

@ -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