1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 03:40:34 +02:00

make-weak-key-hash-table vacuuming

* libguile/hashtab.c (scm_make_weak_key_hash_table): Whoops, fix the
  case I actually cared about.
This commit is contained in:
Andy Wingo 2011-02-25 10:48:35 +01:00
parent 080a9d4f56
commit 6800f86d63

View file

@ -456,11 +456,17 @@ SCM_DEFINE (scm_make_weak_key_hash_table, "make-weak-key-hash-table", 0, 1, 0,
"would modify regular hash tables. (@pxref{Hash Tables})")
#define FUNC_NAME s_scm_make_weak_key_hash_table
{
SCM ret;
if (SCM_UNBNDP (n))
return make_hash_table (SCM_HASHTABLEF_WEAK_CAR, 0, FUNC_NAME);
ret = make_hash_table (SCM_HASHTABLEF_WEAK_CAR, 0, FUNC_NAME);
else
return make_hash_table (SCM_HASHTABLEF_WEAK_CAR,
scm_to_ulong (n), FUNC_NAME);
ret = make_hash_table (SCM_HASHTABLEF_WEAK_CAR,
scm_to_ulong (n), FUNC_NAME);
scm_c_register_weak_gc_callback (ret, vacuum_weak_hash_table);
return ret;
}
#undef FUNC_NAME