120 - forgot to alloc space for array length
This commit is contained in:
parent
d43f0c54e2
commit
fde987b54f
2
mu.arc
2
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)
|
||||
|
|
4
mu.arc.t
4
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)
|
||||
|
|
Loading…
Reference in New Issue