12345678910111213141516171819202122232425262728 |
- #ifndef ALLOCATOR_H
- #define ALLOCATOR_H
- #include <stdbool.h>
- typedef struct {
- int length;
- int next;
- bool marked;
- // Object* data;
- } Array;
- typedef struct {
- int capacity;
- int usedStart;
- int freeStart;
- Array* data;
- } Allocator;
- void aInit(Allocator* a);
- void aDelete(Allocator* a);
- int aAllocate(Allocator* a, int length);
- void aClearMarker(Allocator* a);
- void aRemoveUnmarked(Allocator* a);
- #endif
|