about summary refs log tree commit diff stats
path: root/mu.arc.t
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-01-26 02:42:30 -0800
committerKartik K. Agaram <vc@akkartik.com>2015-01-26 02:42:30 -0800
commit1ea0b4e57922e5cb69193b5118b91a2a3da33d95 (patch)
treee8155fbb3b5fda2b22c1b4b1356feda4ca7a3776 /mu.arc.t
parentf9d8b661fb73281d3b8d844833134fcc8098fc2c (diff)
downloadmu-1ea0b4e57922e5cb69193b5118b91a2a3da33d95.tar.gz
627
Diffstat (limited to 'mu.arc.t')
-rw-r--r--mu.arc.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t
index 0bb64788..cc5be550 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -1902,6 +1902,31 @@
   (when (~is rep.routine!alloc-max 50)
     (prn "F - 'new' updates upper bound for routine memory @rep.routine!alloc-max")))
 
+(reset)
+(new-trace "new-skip")
+(add-code
+  '((function main [
+      (1:integer-boolean-pair-address <- new integer-boolean-pair:literal)
+     ])))
+; start allocating from address 30, in chunks of 10 locations each
+(= Memory-allocated-until 30
+   Allocation-chunk 10)
+(let routine make-routine!main
+  (assert:is rep.routine!alloc 30)
+  (assert:is rep.routine!alloc-max 40)
+  ; pretend the current chunk has just one location left
+  (= rep.routine!alloc 39)
+  (enq routine running-routines*)
+  ; request 2 locations
+  (run)
+  (each routine completed-routines*
+    (aif rep.routine!error (prn "error - " it)))
+  (when (or (~is memory*.1 40)
+            (~is rep.routine!alloc 42)
+            (~is rep.routine!alloc-max 50)
+            (~is Memory-allocated-until 50))
+    (prn "F - 'new' skips past current chunk if insufficient space")))
+
 ; Even though our memory locations can now have names, the names are all
 ; globals, accessible from any function. To isolate functions from their
 ; callers we need local variables, and mu provides them using a special
lame/src/main.c?id=3d0915d1265280ecb070da15cd7a31e9a0b16e7c'>^
9433dcc ^
c020a30 ^
1aa1b17 ^


c020a30 ^
1aa1b17 ^


05c6ad2 ^
21b272f ^
9433dcc ^








1aa1b17 ^
9433dcc ^





283fb7c ^
6fd50ed ^
520a610 ^
6fd50ed ^






1b5697b ^
520a610 ^
c020a30 ^
6fd50ed ^






056dbd9 ^



b1de600
6fd50ed ^
b8dda4d ^
b1de600

21b272f ^
b1de600
e3daf6b ^


e3daf6b ^
e3daf6b ^



b1de600



f0592f8 ^
b1de600


c1811dc ^
b1de600
c020a30 ^
e3daf6b ^
b1de600
c020a30 ^
e3daf6b ^
b1de600
c020a30 ^
e3daf6b ^
b1de600
c020a30 ^
e3daf6b ^
8d19dc6 ^
c020a30 ^
e3daf6b ^
8d19dc6 ^
c020a30 ^
e3daf6b ^
b1de600



b8dda4d ^
b1de600
b8dda4d ^
b1de600

b8dda4d ^
b1de600
b8dda4d ^
b1de600


01a21af ^
b8dda4d ^
b1de600






b8dda4d ^
b1de600



b8dda4d ^
b1de600


fa2a4d7 ^
488823e ^
f769bb9 ^
c020a30 ^
6fd50ed ^
e0e2026 ^
6fd50ed ^

b1de600
2dd8b8b ^
b1de600



01a21af ^
2dd8b8b ^
c020a30 ^
9433dcc ^



c020a30 ^
283fb7c ^
b1de600
c020a30 ^


b1de600
b1de600
b1de600
c020a30 ^
9cb1d20 ^
b8dda4d ^
f0592f8 ^
c1811dc ^
c020a30 ^
f0592f8 ^
c1811dc ^



c020a30 ^
c1811dc ^











c020a30 ^
c1811dc ^
b1de600
c020a30 ^
c1811dc ^











f0592f8 ^
9433dcc ^

c1811dc ^
c020a30 ^
f0592f8 ^




c020a30 ^
f0592f8 ^

c020a30 ^
e372341 ^

c020a30 ^
e372341 ^


c020a30 ^
8d19dc6 ^


e372341 ^

b1de600
b1de600
e372341 ^
c020a30 ^
b8dda4d ^


b1de600


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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253