diff options
author | Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com> | 2021-09-09 15:35:47 -0400 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:40 -0400 |
commit | 11599e5e1ebed485089a994753a9c3c79416c037 (patch) | |
tree | f6e868aeaa01cbf2c53f07150cf7e75c337c10b6 /darray.h | |
parent | f380856923f066e02fb1233c720a6abdc645d11f (diff) |
Add rb_darray_clear() for Kevin. Fix some warnings.
Diffstat (limited to 'darray.h')
-rw-r--r-- | darray.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -84,6 +84,11 @@ // #define rb_darray_make(ptr_to_ary, size) rb_darray_make_impl((ptr_to_ary), size, sizeof(**(ptr_to_ary)), sizeof((*(ptr_to_ary))->data[0])) +// Set the size of the array to zero without freeing the backing memory. +// Allows reusing the same array. +// +#define rb_darray_clear(ary) (ary->meta.size = 0) + typedef struct rb_darray_meta { int32_t size; int32_t capa; |