Ylva And Malin
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
File List
Globals
game
src
ym
container
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
{
8
u32
size
;
9
u32
capacity
;
10
11
// Should also add allocator?
12
}
ym_array_header
;
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)
ym_array_header::capacity
u32 capacity
Definition:
ym_array.h:9
ym_array_header::size
u32 size
Definition:
ym_array.h:8
ym_core.h
u32
uint32_t u32
Definition:
ym_types.h:10
ym_array_header
Definition:
ym_array.h:6
Generated by
1.8.11