Browse Source

Add dynarray-clear

windows-imgui
Macoy Madson 9 months ago
parent
commit
e40aa9403b
  1. 6
      src/DynamicArray.cake

6
src/DynamicArray.cake

@ -33,6 +33,12 @@
;; Make room but don't change the length, so you can push without resize
(def-c-function-alias dynarray-set-capacity arrsetcap) ;; (array (* T))
;; Does not free, only sets length to 0
(defmacro dynarray-clear (array-to-clear any)
(tokenize-push output
(dynarray-set-length (token-splice array-to-clear) 0))
(return true))
(defmacro each-in-dynarray (dynarray any iterator-name symbol &rest body any)
(tokenize-push output
(c-for

Loading…
Cancel
Save