18 #ifndef Q_MEMORY_MANAGER
19 #define Q_MEMORY_MANAGER ( 1 )
22 #if ( Q_MEMORY_MANAGER == 1 )
24 #ifndef Q_BYTE_ALIGNMENT
25 #define Q_BYTE_ALIGNMENT ( 8 )
28 #ifndef Q_DEFAULT_HEAP_SIZE
29 #define Q_DEFAULT_HEAP_SIZE ( 512 )
32 #if ( Q_DEFAULT_HEAP_SIZE < 64 )
33 #error Q_DEFAULT_HEAP_SIZE it is too small. Min(64).
36 #if ( ( Q_BYTE_ALIGNMENT != 1 ) && ( Q_BYTE_ALIGNMENT != 2 ) && ( Q_BYTE_ALIGNMENT != 4 ) && ( Q_BYTE_ALIGNMENT != 8 ) )
37 #error Q_BYTE_ALIGNMENT value not allowed, use only 1,2,4 or 8(default).
48 typedef struct _qMemMang_BlockConnect_s {
49 struct _qMemMang_BlockConnect_s *next;
52 qMemMang_BlockConnect_t;
74 typedef struct _qMemMang_Pool_s {
76 struct _qMemMang_Pool_Private_s {
77 qMemMang_BlockConnect_t *end;
80 size_t freeBytesRemaining;
81 qMemMang_BlockConnect_t start;
98 qBool_t qMemMang_Pool_Setup( qMemMang_Pool_t *
const mPool,
100 const size_t pSize );
108 qBool_t qMemMang_Pool_Select( qMemMang_Pool_t *
const mPool );
117 size_t qMemMang_Get_FreeSize(
const qMemMang_Pool_t *mPool );
130 void* qMemMang_Allocate( qMemMang_Pool_t *mPool,
149 qBool_t qMemMang_Free( qMemMang_Pool_t *mPool,
166 void* qMalloc(
size_t mSize );
185 void qFree(
void *ptr );
qUINT8_t qBool_t
A type to instantiate an OS boolean variable.
Definition qtypes.h:139
uint8_t qUINT8_t
Unsigned integer type with width of exactly 8 bits respectively.
Definition qtypes.h:44