about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-12-29 09:15:42 -0800
committerKartik K. Agaram <vc@akkartik.com>2014-12-29 09:15:42 -0800
commit613455f6f81e67ce2e704a3fd022cad920b5c1d7 (patch)
tree62c1514800d88e936d8caaf857f75cd331e28e61
parent68c45cb8e68df88dc6a3f7a9f11a0b764fc31cd7 (diff)
downloadmu-613455f6f81e67ce2e704a3fd022cad920b5c1d7.tar.gz
459 - stop recycling memory between routines
I forgot that we have a test with multiple calls to 'run' without
intervening 'reset'.
-rw-r--r--mu.arc9
1 files changed, 7 insertions, 2 deletions
diff --git a/mu.arc b/mu.arc
index 1c756803..7265f363 100644
--- a/mu.arc
+++ b/mu.arc
@@ -146,10 +146,15 @@
 
 ;; managing concurrent routines
 
+(on-init
+  (= Memory-allocated-until 1000))
+
 ; routine = runtime state for a serial thread of execution
 (def make-routine (fn-name . args)
-  (annotate 'routine (obj alloc 1000  call-stack (list
-      (obj fn-name fn-name  pc 0  args args  caller-arg-idx 0)))))
+  (do1
+    (annotate 'routine (obj alloc Memory-allocated-until call-stack (list
+        (obj fn-name fn-name  pc 0  args args  caller-arg-idx 0))))
+    (++ Memory-allocated-until 1000)))
 
 (defextend empty (x)  (isa x 'routine)
   (no rep.x!call-stack))