diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2016-10-07 21:50:47 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2016-10-07 21:50:47 -0700 |
commit | 0fdf7390864f8bc619741aff777cb5d2560d9f1c (patch) | |
tree | a8fcaecb89af88d0a9b0a298f5df59123fc3ef36 /struct.c | |
parent | 2b249216eba72f0ea9700b7eede3711ff45a1327 (diff) | |
download | txr-0fdf7390864f8bc619741aff777cb5d2560d9f1c.tar.gz txr-0fdf7390864f8bc619741aff777cb5d2560d9f1c.tar.bz2 txr-0fdf7390864f8bc619741aff777cb5d2560d9f1c.zip |
gc issues in clear_struct and replace_struct.
* struct.c (clear_struct, reset_struct): Inform the garbage
collector that the structure has been mutate, using the mut
macro. This is required for correctness because the structure
may be a mature object receiving young generation values.
Diffstat (limited to 'struct.c')
-rw-r--r-- | struct.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -599,6 +599,8 @@ val clear_struct(val strct, val value) for (i = 0; i < st->nslots; i++) si->slot[i] = clear_val; + mut(strct); + return strct; } @@ -621,6 +623,7 @@ val replace_struct(val target, val source) free(tsi); target->co.handle = coerce(mem_t *, ssi_copy); target->co.cls = source->co.cls; + mut(target); } return target; |