about summary refs log tree commit diff stats
path: root/055shape_shifting_container.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-17 12:14:09 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-17 12:14:09 -0700
commit75ab8732386096a77113514f767e134e42a5435f (patch)
treea3fd2a9a578b8fd3965b8c7f6905600fbbcfcb58 /055shape_shifting_container.cc
parented8e4c17417828528fbb2350b19f24d73c989fc9 (diff)
downloadmu-75ab8732386096a77113514f767e134e42a5435f.tar.gz
3212 - bugfix in refcount management
When updating refcounts for a typed segment of memory being copied over
with another, we were only ever using the new copy's data to determine
any tags for exclusive containers. Looks like the right way to do
refcounts is to increment and decrement separately.

Hopefully this is a complete fix for the intermittent but
non-deterministic errors we've been encountering while running the edit/
app.
Diffstat (limited to '055shape_shifting_container.cc')
-rw-r--r--055shape_shifting_container.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/055shape_shifting_container.cc b/055shape_shifting_container.cc
index ce595730..88e9fb97 100644
--- a/055shape_shifting_container.cc
+++ b/055shape_shifting_container.cc
@@ -189,14 +189,19 @@ def main [
   3:foo:point <- merge 0/x, 15, 16
   6:foo:point <- merge 1/y, 23
 ]
++run: {1: ("foo" "number")} <- merge {0: "literal", "x": ()}, {34: "literal"}
 +mem: storing 0 in location 1
 +mem: storing 34 in location 2
++run: {3: ("foo" "point")} <- merge {0: "literal", "x": ()}, {15: "literal"}, {16: "literal"}
 +mem: storing 0 in location 3
 +mem: storing 15 in location 4
 +mem: storing 16 in location 5
++run: {6: ("foo" "point")} <- merge {1: "literal", "y": ()}, {23: "literal"}
 +mem: storing 1 in location 6
 +mem: storing 23 in location 7
-$mem: 7
++run: reply
+# no other stores
+% CHECK(trace_count_prefix("mem", "storing") == 7);
 
 :(scenario get_on_shape_shifting_container)
 container foo:_t [