Add object pool

This commit is contained in:
2023-11-15 20:15:59 +01:00
parent 0a44f7b2dc
commit 581da2b990
3 changed files with 82 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
#ifndef BREEZE_OBJECT_POOL_H
#define BREEZE_OBJECT_POOL_H
#include "../defines.h"
typedef struct BzObjectPool BzObjectPool;
typedef struct BzObjectPoolDesc {
size_t objectSize;
size_t numObjects;
} BzObjectPoolDesc;
BzObjectPool *bzObjectPoolCreate(const BzObjectPoolDesc *desc);
void bzObjectPoolDestroy(BzObjectPool *pool);
void *bzObjectPool(BzObjectPool *pool);
void bzObjectPoolRelease(BzObjectPool *pool, void *object);
#endif //BREEZE_OBJECT_POOL_H