diff options
author | Andy Wingo <wingo@pobox.com> | 2011-02-25 10:48:35 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2011-02-25 10:48:35 +0100 |
commit | 6800f86d63c4953fe705f6f74e252fb2bd9cc8c8 (patch) | |
tree | cb6229a11959ec0579b00998f0a24f800afc8583 /libguile/hashtab.c | |
parent | 080a9d4f564c1b4e2171aa35a2a50fe20c300ecd (diff) | |
download | guile-6800f86d63c4953fe705f6f74e252fb2bd9cc8c8.tar.gz |
make-weak-key-hash-table vacuuming
* libguile/hashtab.c (scm_make_weak_key_hash_table): Whoops, fix the
case I actually cared about.
Diffstat (limited to 'libguile/hashtab.c')
-rw-r--r-- | libguile/hashtab.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libguile/hashtab.c b/libguile/hashtab.c index 4c4c10691..a76c03812 100644 --- a/libguile/hashtab.c +++ b/libguile/hashtab.c @@ -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 |