1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2024-12-14 02:23:55 +01:00
rpi-vk-driver/driver/PoolAllocator.h
2020-06-08 18:54:57 +01:00

27 lines
523 B
C

#pragma once
#if defined (__cplusplus)
extern "C" {
#endif
#include "CustomAssert.h"
#include <stdint.h>
typedef struct PoolAllocator
{
void* buf; //preallocated buffer
void* nextFreeBlock;
unsigned blockSize;
unsigned size; //size is exact multiple of block size
} PoolAllocator;
PoolAllocator createPoolAllocator(void* b, unsigned bs, unsigned s);
void destroyPoolAllocator(PoolAllocator* pa);
void* poolAllocate(PoolAllocator* pa);
void poolFree(PoolAllocator* pa, void* p);
#if defined (__cplusplus)
}
#endif