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 | a03f5ae592c44fb2572f297422e2c63e585e6a06 (patch) | |
tree | a8fcaecb89af88d0a9b0a298f5df59123fc3ef36 | |
parent | 298a6439575e59a460a6596364f112a219e9b3c2 (diff) | |
download | txr-a03f5ae592c44fb2572f297422e2c63e585e6a06.tar.gz txr-a03f5ae592c44fb2572f297422e2c63e585e6a06.tar.bz2 txr-a03f5ae592c44fb2572f297422e2c63e585e6a06.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.
-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; |