1
0
mirror of https://github.com/Yours3lf/rpi-vk-driver.git synced 2024-12-01 13:24:20 +01:00
rpi-vk-driver/driver/LinearAllocator.h
2018-08-26 14:11:43 +01:00

27 lines
478 B
C

#pragma once
#if defined (__cplusplus)
extern "C" {
#endif
#include "CustomAssert.h"
#include <stdint.h>
typedef struct LinearAllocator
{
char* buf; //preallocated buffer
unsigned offset;
unsigned size;
} LinearAllocator;
LinearAllocator createLinearAllocator(char* b, unsigned s);
void destroyLinearAllocator(LinearAllocator* la);
void* linearAllocte(LinearAllocator* la, unsigned s);
void linearFree(LinearAllocator* la, void* p);
#if defined (__cplusplus)
}
#endif