diff options
author | justanothercatgirl <sotov@twistea.su> | 2025-03-22 14:09:55 +0300 |
---|---|---|
committer | justanothercatgirl <sotov@twistea.su> | 2025-03-22 14:09:55 +0300 |
commit | 0612bfa57649c4bffea0ca6e436539d8c3193a80 (patch) | |
tree | 67f98dcd8bf98194761c0ea3de4c2d48ca674bea /include/container.h | |
parent | ff8ab43201e5c862003d9353016409c13691562c (diff) |
Added json serializer/parser
Diffstat (limited to 'include/container.h')
-rw-r--r-- | include/container.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/container.h b/include/container.h index 1401162..5f40e4a 100644 --- a/include/container.h +++ b/include/container.h @@ -130,6 +130,8 @@ typedef void*(*memcpy_t)(void* restrict, const void*, size_t); } while(0) /* Removes last element from the array */ #define array_pop(array) --array_header(array)->size +/* get last element of an array */ +#define array_last(array) (array)[array_header((array))->size - 1] /* Reserve length elements so that subsequent (length - current_size) pushes require no reallocation */ #define array_reserve(array, length) do { array = _memreserve_dynarray(array, length); } while (0) /* Change size of an array. the capacity is set to lowest power of 2 that is greater than length */ |