Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

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

Data Fields

const void * 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 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


Field Documentation

const void* psMemBlock::endblock
 

initialised to p_psMEMMAGIC

Definition at line 77 of file psMemory.h.

const char* psMemBlock::file
 

set from __FILE__ in e.g. p_psAlloc

Definition at line 72 of file psMemory.h.

psFreeFunc psMemBlock::freeFunc
 

deallocator. If NULL, use generic deallocation.

Definition at line 69 of file psMemory.h.

const psMemId psMemBlock::id
 

a unique ID for this allocation

Definition at line 71 of file psMemory.h.

const unsigned int psMemBlock::lineno
 

set from __LINE__ in e.g. p_psAlloc

Definition at line 73 of file psMemory.h.

struct psMemBlock* psMemBlock::nextBlock
 

next block allocation list

Definition at line 68 of file psMemory.h.

bool psMemBlock::persistent
 

marks if this non-user persistent data like error stack, etc.

Definition at line 76 of file psMemory.h.

struct psMemBlock* psMemBlock::previousBlock
 

previous block in allocation list

Definition at line 67 of file psMemory.h.

psReferenceCount psMemBlock::refCounter
 

how many times pointer is referenced

Definition at line 75 of file psMemory.h.

pthread_mutex_t psMemBlock::refCounterMutex
 

mutex to ensure exclusive access to reference counter

Definition at line 74 of file psMemory.h.

const void* psMemBlock::startblock
 

initialised to p_psMEMMAGIC

Definition at line 66 of file psMemory.h.

size_t psMemBlock::userMemorySize
 

the size of the user-portion of the memory block

Definition at line 70 of file psMemory.h.


The documentation for this struct was generated from the following file:
Generated on Thu Oct 13 14:33:47 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.2