diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-01-26 02:40:35 -0800 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-01-26 02:40:35 -0800 |
commit | f9d8b661fb73281d3b8d844833134fcc8098fc2c (patch) | |
tree | 2f722412962c9cdcaf072e554528dd39b70898ba /mu.arc.t | |
parent | be6eb09211ca8470836152a1aa9d1536ce753bc6 (diff) | |
download | mu-f9d8b661fb73281d3b8d844833134fcc8098fc2c.tar.gz |
626 - start eliminating the memory-per-routine limit
Diffstat (limited to 'mu.arc.t')
-rw-r--r-- | mu.arc.t | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/mu.arc.t b/mu.arc.t index b9a0aba7..0bb64788 100644 --- a/mu.arc.t +++ b/mu.arc.t @@ -1879,6 +1879,29 @@ (when (~iso rep.routine!alloc (+ before 6)) (prn "F - 'new' on primitive arrays increments high-water mark by their (variable) size")))) +(reset) +(new-trace "new-allocation-chunk") +(add-code + '((function main [ + (1:integer-address <- new integer: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 is full + (= rep.routine!alloc 40) + (enq routine running-routines*) + (run) + (each routine completed-routines* + (aif rep.routine!error (prn "error - " it))) + (when (~is rep.routine!alloc 41) + (prn "F - 'new' can allocate past initial routine memory")) + (when (~is rep.routine!alloc-max 50) + (prn "F - 'new' updates upper bound for routine memory @rep.routine!alloc-max"))) + ; 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 |