Add stack allocator
This commit is contained in:
18
engine/breeze/memory/stack_alloc.h
Normal file
18
engine/breeze/memory/stack_alloc.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef BREEZE_STACK_ALLOC_H
|
||||
#define BREEZE_STACK_ALLOC_H
|
||||
|
||||
#include "../defines.h"
|
||||
|
||||
typedef struct BzStackAlloc {
|
||||
void *memory;
|
||||
size_t size;
|
||||
size_t allocated;
|
||||
} BzStackAlloc;
|
||||
|
||||
BzStackAlloc bzStackAllocCreate(size_t size);
|
||||
void bzStackAllocDestroy(BzStackAlloc *alloc);
|
||||
|
||||
void *bzStackAlloc(BzStackAlloc *alloc, size_t numBytes);
|
||||
void bzStackAllocFree(BzStackAlloc *alloc, void *ptr);
|
||||
|
||||
#endif //BREEZE_STACK_ALLOC_H
|
||||
Reference in New Issue
Block a user