#include <psMemory.h>
Collaboration diagram for psMemBlock:

N.b. sizeof(psMemBlock) must be chosen such that if ptr is a pointer returned by malloc, then ((char *)ptr + sizeof(psMemBlock)) is properly aligned for all storage types.
Definition at line 64 of file psMemory.h.
Data Fields | |
| const void * | startblock |
| initialised to p_psMEMMAGIC | |
| psMemBlock * | previousBlock |
| previous block in allocation list | |
| psMemBlock * | nextBlock |
| next block allocation list | |
| psFreeFunc | freeFunc |
| deallocator. If NULL, use generic deallocation. | |
| size_t | userMemorySize |
| the size of the user-portion of the memory block | |
| const psMemId | id |
| a unique ID for this allocation | |
| const char * | file |
| set from __FILE__ in e.g. p_psAlloc | |
| const unsigned int | lineno |
| set from __LINE__ in e.g. p_psAlloc | |
| pthread_mutex_t | refCounterMutex |
| mutex to ensure exclusive access to reference counter | |
| psReferenceCount | refCounter |
| how many times pointer is referenced | |
| bool | persistent |
| marks if this non-user persistent data like error stack, etc. | |
| const void * | endblock |
| initialised to p_psMEMMAGIC | |
|
|
initialised to p_psMEMMAGIC
Definition at line 77 of file psMemory.h. |
|
|
set from __FILE__ in e.g. p_psAlloc
Definition at line 72 of file psMemory.h. |
|
|
deallocator. If NULL, use generic deallocation.
Definition at line 69 of file psMemory.h. |
|
|
a unique ID for this allocation
Definition at line 71 of file psMemory.h. |
|
|
set from __LINE__ in e.g. p_psAlloc
Definition at line 73 of file psMemory.h. |
|
|
next block allocation list
Definition at line 68 of file psMemory.h. |
|
|
marks if this non-user persistent data like error stack, etc.
Definition at line 76 of file psMemory.h. |
|
|
previous block in allocation list
Definition at line 67 of file psMemory.h. |
|
|
how many times pointer is referenced
Definition at line 75 of file psMemory.h. |
|
|
mutex to ensure exclusive access to reference counter
Definition at line 74 of file psMemory.h. |
|
|
initialised to p_psMEMMAGIC
Definition at line 66 of file psMemory.h. |
|
|
the size of the user-portion of the memory block
Definition at line 70 of file psMemory.h. |
1.4.2