Add function to create array from preallocated buffer

This commit is contained in:
Abdelrahman Said
2026-01-24 20:45:52 +00:00
parent 7a54c28c0f
commit 8e41b627bc
2 changed files with 26 additions and 7 deletions
+2
View File
@@ -174,6 +174,8 @@ typedef enum {
#define wapp_array_calc_alloc_size(TYPE, CAPACITY) _array_calc_alloc_size(CAPACITY, sizeof(TYPE))
#define wapp_array_alloc_capacity(TYPE, ALLOCATOR_PTR, CAPACITY, FLAGS) \
((TYPE *)_array_alloc_capacity(ALLOCATOR_PTR, CAPACITY, FLAGS, sizeof(TYPE)))
#define wapp_array_from_preallcated_buffer(TYPE, BUFFER, BUFFER_SIZE) \
((TYPE *)_array_from_preallcated_buffer(BUFFER, BUFFER_SIZE, sizeof(TYPE)))
typedef struct header ArrayHeader;