Files
jak-project/test/goalc/source_templates/with_game/test-integer-boxed-array.gc
T
water111 3355df809a Add boxed array type (#163)
* add array

* support static arrays
2020-12-19 21:05:18 -05:00

13 lines
321 B
Common Lisp

(let ((arr (new 'global 'boxed-array int16 12)))
(dotimes (i 12)
(set! (-> arr i) (* i 2))
)
(dotimes (i 12)
(format #t "~D ~D " i (-> arr i))
)
(format #t "~D ~D ~D~%" (length arr) (asize-of arr) (&- (&-> arr 4) (&-> arr 1)))
)
;; asize should be...
;; 16 + 12 * 2 = 40
;; ptr diff is 3 * 2 = 6