From 09f46245273096a6cca6176d0e8302cf2969b6dc Mon Sep 17 00:00:00 2001 From: ahmedsamyh Date: Wed, 26 Feb 2025 22:59:29 +0500 Subject: [PATCH] [commonlib.h] da_free. --- commonlib.h | 2 ++ 1 file changed, 2 insertions(+) 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 -- 2.39.5