26#define OBJECT_POOL(a) a*
27#define NEW_OBJECT_POOL(a, size) ((a*)InitObjectPool(sizeof(a),size))
29#define ObjectPoolCapacity(pObjectPool) ((((struct ObjectPoolData*)pObjectPool) - 1)->capacity)
31#define OBJ_POOL_BOUNDS_CHECK(handle, rVal, pool)\
33 bool bBoundsValid = handle < ObjectPoolCapacity(pool) && handle >= 0;\
35 printf("function '%s' invalid bounds handle %i", __FUNCTION__, handle);\
40#define OBJ_POOL_BOUNDS_CHECK_NO_RETURN(handle, pool)\
42 bool bBoundsValid = handle < ObjectPoolCapacity(pool) && handle >= 0;\
44 printf("function '%s' invalid bounds handle %i", __FUNCTION__, handle);\
49#define ObjectPoolFreeArraySize(pObjectPool) (((struct ObjectPoolData*)pObjectPool) - 1)->freeObjectsArraySize
uint64_t u64
Definition IntTypes.h:15
int64_t i64
Definition IntTypes.h:16
void FreeObjectPoolIndex(void *pObjectPool, int indexToFree)
Definition ObjectPool.c:61
void * FreeObjectPool(void *pObjectPool)
Definition ObjectPool.c:80
void * InitObjectPool(int objectSize, int poolInitialSize)
Definition ObjectPool.c:10
void * GetObjectPoolIndex(void *pObjectPool, int *pOutIndex)
returns the object pool, possibly resized. returns index of a free space in the pool through pOutInde...
Definition ObjectPool.c:50
16 byte aligned
Definition ObjectPool.h:19
i64 capacity
Definition ObjectPool.h:21
u64 * freeObjectIndicessArray
Definition ObjectPool.h:23
i64 freeObjectsArraySize
Definition ObjectPool.h:22
i64 objectSize
Definition ObjectPool.h:20