From: ahmedsamyh Date: Wed, 26 Feb 2025 17:59:29 +0000 (+0500) Subject: [commonlib.h] da_free. X-Git-Url: https://www.git.momoyon.org/?a=commitdiff_plain;h=09f46245273096a6cca6176d0e8302cf2969b6dc;p=commonlib.git [commonlib.h] da_free. --- diff --git a/commonlib.h b/commonlib.h index 7af1d7b..460fe4b 100644 --- a/commonlib.h +++ b/commonlib.h @@ -21,6 +21,7 @@ #define ARRAY_LEN c_ARRAY_LEN #define da_append c_da_append +#define da_free c_da_free #define DYNAMIC_ARRAY_INITIAL_CAPACITY c_DYNAMIC_ARRAY_INITIAL_CAPACITY // #define c_DYNAMIC_ARRAY_INITIAL_CAPACITY @@ -164,6 +165,7 @@ typedef struct c_Arena c_Arena; } while (0) #define c_da_pop_front(da) (c_ASSERT(da.count > 0, "Array is empty"), da.count--, *da.items++) +#define c_da_free(da) C_FREE(da.items) // // OS