about summary refs log tree commit diff stats
path: root/036refcount.cc
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2016-08-16 14:52:05 -0700
committerKartik K. Agaram <vc@akkartik.com>2016-08-16 14:52:05 -0700
commit1cd2691b0637cd0ab6be6576e487c0140083ba86 (patch)
tree9ed2add37dc701bca776a9ef7efa909fbb5b7306 /036refcount.cc
parent86033d4bdd44c5d50abfd6370adc026a14f8c9ae (diff)
downloadmu-1cd2691b0637cd0ab6be6576e487c0140083ba86.tar.gz
3199
Never mind, just close your nose and replace that function parameter
with a global variable.

This may not always be the solution for the problem of layers being
unable to add parameters and arguments, but here it works well and it's
unclear what problems the global might cause.
Diffstat (limited to '036refcount.cc')
-rw-r--r--036refcount.cc10
1 files changed, 4 insertions, 6 deletions
diff --git a/036refcount.cc b/036refcount.cc
index 51a0945a..c1a12525 100644
--- a/036refcount.cc
+++ b/036refcount.cc
@@ -17,8 +17,11 @@ def main [
 +run: {2: ("address" "number")} <- copy {0: "literal"}
 +mem: decrementing refcount of 1000: 1 -> 0
 
+:(before "End Globals")
+//: escape hatch for a later layer
+bool Update_refcounts_in_write_memory = true;
 :(before "End write_memory(x) Special-cases")
-if (should_update_refcounts_in_write_memory(saving_instruction_products)) {
+if (Update_refcounts_in_write_memory) {
   if (is_mu_address(x)) {
     assert(scalar(data));
     assert(x.value);
@@ -29,11 +32,6 @@ if (should_update_refcounts_in_write_memory(saving_instruction_products)) {
 }
 
 :(code)
-//: hook for a later layer
-bool should_update_refcounts_in_write_memory(bool conditional_update) {
-  return true;
-}
-
 void update_refcounts(const reagent& old, int new_address) {
   assert(is_mu_address(old));
   update_refcounts(get_or_insert(Memory, old.value), new_address, old.type->right, payload_size(old));