diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-08-16 14:52:05 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-08-16 14:52:05 -0700 |
commit | 1cd2691b0637cd0ab6be6576e487c0140083ba86 (patch) | |
tree | 9ed2add37dc701bca776a9ef7efa909fbb5b7306 /036refcount.cc | |
parent | 86033d4bdd44c5d50abfd6370adc026a14f8c9ae (diff) | |
download | mu-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.cc | 10 |
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)); |