Ylva And Malin
ym_array.h
Go to the documentation of this file.
1 #pragma once
2 #include <ym_core.h>
3 
4 // Taken from & Based on: http://ourmachinery.com/post/minimalist-container-library-in-c-part-1/
5 
6 typedef struct
7 {
10 
11  // Should also add allocator?
13 
14 // Find out how to deal with it having an allocation and deallocation strategy
15 
16 #define ym_array_get_header(array) \
17  ((ym_array_header*)((char*)(array) - sizeof(ym_array_header)))
18 
19 #define ym_array_size(array) \
20  ((array) ? ym_array_get_header(array)->size : 0)
u32 capacity
Definition: ym_array.h:9
u32 size
Definition: ym_array.h:8
uint32_t u32
Definition: ym_types.h:10
Definition: ym_array.h:6