about summary refs log tree commit diff stats
path: root/mu.arc
diff options
context:
space:
mode:
Diffstat (limited to 'mu.arc')
-rw-r--r--mu.arc24
1 files changed, 24 insertions, 0 deletions
diff --git a/mu.arc b/mu.arc
index 01f2586f..c748722f 100644
--- a/mu.arc
+++ b/mu.arc
@@ -36,6 +36,29 @@
   (each f (as cons initialization-fns*)
     (f)))
 
+; kludge to prevent reloading functions in .mu files for every test
+(def reset2 ()
+  (= memory* (table))
+  (= Memory-allocated-until 1000)
+  (awhen curr-trace-file*
+    (tofile (+ trace-dir* it)
+      (each (label trace) (as cons traces*)
+        (pr label ": " trace))))
+  (= curr-trace-file* nil)
+  (= traces* (queue))
+  (wipe dump-trace*)
+  (wipe function*!main)
+  (wipe location*!main)
+  (= running-routines* (queue))
+  (= sleeping-routines* (table))
+  (wipe completed-routines*)
+  (wipe routine*)
+  (= abort-routine* (parameter nil))
+  (= curr-cycle* 0)
+  (= scheduling-interval* 500)
+  (= scheduler-switch-table* nil)
+  )
+
 (mac on-init body
   `(enq (fn () ,@body)
         initialization-fns*))
@@ -1728,6 +1751,7 @@
      (wipe (function* ',name))
      (add-code '((function ,name [ ,@body ])))
      (freeze-another ',name)
+;?      (set dump-trace*) ;? 1
      (run-more ',name)))
 
 (def routine-that-ran (f)