summaryrefslogtreecommitdiffstats
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/hash.c b/hash.c
index 7516a128..d583862f 100644
--- a/hash.c
+++ b/hash.c
@@ -246,6 +246,16 @@ obj_t *gethash(obj_t *hash, obj_t *key)
return cdr(found);
}
+obj_t *remhash(obj_t *hash, obj_t *key)
+{
+ struct hash *h = (struct hash *) hash->co.handle;
+ obj_t **pchain = vecref_l(h->table, num(ll_hash(key) % h->modulus));
+ *pchain = alist_remove1(*pchain, key);
+ h->count--;
+ bug_unless (h->count >= 0);
+ return nil;
+}
+
/*
* Called from garbage collector. Hash module must process all weak tables
* that were visited during the marking phase, maintained in the list