From 1cd2691b0637cd0ab6be6576e487c0140083ba86 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 16 Aug 2016 14:52:05 -0700 Subject: 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. --- 036refcount.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to '036refcount.cc') 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)); -- cgit 1.4.1-2-gfad0 ni-tty/commit/tests/unittests/test_jid.c?id=583fb2b8c66d1af9059763b2f8f56b7f78da246a'>commit diff stats
path: root/tests/unittests/test_jid.c
blob: b7f6ea227f8aa8b6e019949f261bbc345f6c3cfa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185