fallout2-ce/src/heap.h

33 lines
774 B
C
Raw Normal View History

2022-05-19 01:51:26 -07:00
#ifndef HEAP_H
#define HEAP_H
typedef struct HeapHandle {
2022-05-21 08:22:03 -07:00
unsigned int state;
2022-05-19 01:51:26 -07:00
unsigned char* data;
} HeapHandle;
typedef struct Heap {
int size;
int freeBlocks;
int moveableBlocks;
int lockedBlocks;
int systemBlocks;
int handlesLength;
int freeSize;
int moveableSize;
int lockedSize;
int systemSize;
HeapHandle* handles;
unsigned char* data;
} Heap;
bool heapInit(Heap* heap, int a2);
bool heapFree(Heap* heap);
bool heapBlockAllocate(Heap* heap, int* handleIndexPtr, int size, int a3);
bool heapBlockDeallocate(Heap* heap, int* handleIndexPtr);
bool heapLock(Heap* heap, int handleIndex, unsigned char** bufferPtr);
bool heapUnlock(Heap* heap, int handleIndex);
bool heapValidate(Heap* heap);
#endif /* HEAP_H */