diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2014-03-27 19:00:49 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2014-03-27 19:00:49 -0700 |
commit | e44f8e16614283698f648186302ea9d8cadd3066 (patch) | |
tree | 66dc0797c7c5d84d798bbe9dfea0685e4b1fac43 /hash.c | |
parent | b6133333a04b6d29c4e6aa45f6e8917cf29ddc99 (diff) | |
download | txr-e44f8e16614283698f648186302ea9d8cadd3066.tar.gz txr-e44f8e16614283698f648186302ea9d8cadd3066.tar.bz2 txr-e44f8e16614283698f648186302ea9d8cadd3066.zip |
More generational GC fixes. One GC fix.
* combi.c (perm_init_common, comb_gen_fun_common,
rcomb_gen_fun_common): Use set macro instead of plain assignment.
* hash.c (hash_grow, copy_hash, hash_update_1): Use set macro
instead of plain assignment.
* lib.c (nreverse, lazy_appendv_func, lazy_appendv,
vec_push, refset): Use set macro instead of plain assignment.
(make_package): Assign all fields of the newly created PKG
object before calling a function which can trigger GC.
* parser.y (rlset): Use set macro.
Diffstat (limited to 'hash.c')
-rw-r--r-- | hash.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -439,7 +439,7 @@ static void hash_grow(struct hash *h) val key = car(entry); val *pchain = vecref_l(new_table, num_fast(h->hash_fun(key) % new_modulus)); - *cdr_l(conses) = *pchain; + set(*cdr_l(conses), *pchain); *pchain = conses; conses = next; } @@ -518,7 +518,7 @@ val copy_hash(val existing) h->acons_new_c_fun = ex->acons_new_c_fun; for (iter = zero; lt(iter, mod); iter = plus(iter, one)) - *vecref_l(h->table, iter) = copy_alist(vecref(ex->table, iter)); + set(*vecref_l(h->table, iter), copy_alist(vecref(ex->table, iter))); return hash; } @@ -1027,9 +1027,9 @@ val hash_update_1(val hash, val key, val fun, val init) val new_p; val *place = gethash_l(hash, key, &new_p); if (new_p) - *place = funcall1(fun, init); + set(*place, funcall1(fun, init)); else - *place = funcall1(fun, *place); + set(*place, funcall1(fun, *place)); return *place; } } |