about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2014-10-07 14:01:58 -0700
committerKartik K. Agaram <vc@akkartik.com>2014-10-07 14:02:16 -0700
commitfde987b54f32ecb7c26c42322ab5df48e317c236 (patch)
treecc1dfb5ce46879816427b182e91cf56b709d774e
parentd43f0c54e22161687570ad34efa9df8e5a8a2f53 (diff)
downloadmu-fde987b54f32ecb7c26c42322ab5df48e317c236.tar.gz
120 - forgot to alloc space for array length
-rw-r--r--mu.arc2
-rw-r--r--mu.arc.t4
2 files changed, 3 insertions, 3 deletions
diff --git a/mu.arc b/mu.arc
index 239927d8..7a2c4d90 100644
--- a/mu.arc
+++ b/mu.arc
@@ -452,7 +452,7 @@
 (def new-array (type size)
 ;?   (prn "new array: @type @size")
   (ret result Memory-in-use-until
-    (++ Memory-in-use-until (* (sizeof types*.type!elem) size))))
+    (++ Memory-in-use-until (+ 1 (* (sizeof types*.type!elem) size)))))
 
 (def sizeof (type)
   (if (~or types*.type!record types*.type!array)
diff --git a/mu.arc.t b/mu.arc.t
index bc8e4073..7f9e1042 100644
--- a/mu.arc.t
+++ b/mu.arc.t
@@ -802,7 +802,7 @@
   ;? (prn memory*)
   (if (~iso memory*.1 before)
     (prn "F - 'new' on array with literal size returns current high-water mark"))
-  (if (~iso Memory-in-use-until (+ before 5))
+  (if (~iso Memory-in-use-until (+ before 6))
     (prn "F - 'new' on primitive arrays increments high-water mark by their size")))
 
 (reset)
@@ -816,7 +816,7 @@
   ;? (prn memory*)
   (if (~iso memory*.2 before)
     (prn "F - 'new' on array with variable size returns current high-water mark"))
-  (if (~iso Memory-in-use-until (+ before 5))
+  (if (~iso Memory-in-use-until (+ before 6))
     (prn "F - 'new' on primitive arrays increments high-water mark by their (variable) size")))
 
 (reset)