psMemBlock Struct Reference
[MemoryManagement]

#include <psMemory.h>

Collaboration diagram for psMemBlock:

Collaboration graph
[legend]

Detailed Description

Book-keeping data for storage allocator.

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 57 of file psMemory.h.

Data Fields

const psU32 startblock
 initialised to p_psMEMMAGIC
psMemBlockpreviousBlock
 previous block in allocation list
psMemBlocknextBlock
 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 pthread_t tid
 set from pthread_self();
const char * file
 set from __FILE__ in e.g. p_psAlloc
const unsigned int lineno
 set from __LINE__ in e.g. p_psAlloc
const char * func
 set from __func__
psReferenceCount refCounter
 how many times pointer is referenced
bool persistent
 marks if this non-user persistent data like error stack, etc.
const psU32 endblock
 initialised to p_psMEMMAGIC


Field Documentation

const psU32 psMemBlock::startblock

initialised to p_psMEMMAGIC

Definition at line 59 of file psMemory.h.


The documentation for this struct was generated from the following file:
Generated on Fri Feb 2 22:25:55 2007 for pslib by  doxygen 1.5.1