Files
cKit/Memory/c_FixedPool.h
T
2026-08-29 00:53:40 +08:00

27 lines
823 B
C

#ifndef INCLUDED_C_FIXEDPOOL_H
#define INCLUDED_C_FIXEDPOOL_H
#ifndef INCLUDED_C_TYPES_H
#include <c_Types.h>
#endif /*INCLUDED_C_TYPES_H*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
typedef struct {
int objSize;
c_int_t instanceCount;
struct c_FixedPoolLink_t{ struct c_FixedPoolLink_t* next;} * freelist;
}c_FixedPool_t;
c_err_t c_FixedPool_Init(c_FixedPool_t* self, int objSize, void* block, int block_size);
void c_FixedPool_Destroy(c_FixedPool_t* self);
c_err_t c_FixedPool_AddBlock(c_FixedPool_t* self, void* block, int block_size);
void* c_FixedPool_Alloc(c_FixedPool_t* self);
void c_FixedPool_Free(c_FixedPool_t* self, void* ptr);
void c_FixedPool_DryUp(c_FixedPool_t* self);
#endif /*INCLUDED_C_FIXEDPOOL_H*/