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

Memory Tracing
[MemoryManagement]

Collaboration diagram for Memory Tracing:


Detailed Description

Routines dealing with memory tracing and corruption checking.


Functions

int psMemCheckLeaks (psMemId id0, psMemBlock ***array, FILE *fd, bool persistence)
 Check for memory leaks.
int psMemCheckCorruption (bool abort_on_error)
 Check for memory corruption.


Function Documentation

int psMemCheckCorruption bool  abort_on_error  ) 
 

Check for memory corruption.

Scans all currently allocated memory buffers and checks for corruptions, i.e., invalid markers that signify a buffer under/overflow.

Returns:
int
Parameters:
abort_on_error  Abort on detecting corruption?

int psMemCheckLeaks psMemId  id0,
psMemBlock ***  array,
FILE *  fd,
bool  persistence
 

Check for memory leaks.

This scans for allocated memory buffers not freed with an ID not less than id0. This is used to check for memory leaks by:

  1. before a block of code to be checked, store the current ID count via psGetMemId
  2. after the block of code to be checked, call this function using the ID stored above. If all memory in the block that was allocated has been freed, this call should output nothing and return 0.

If memory leaks are found, the Memory Problem callback will be called as well.

Returns:
int number of memory blocks found as 'leaks', i.e., the number of currently allocated memory blocks above id0 that have not been freed.
See also:
psAlloc, psFree, psgetMemId, psMemProblemCallbackSet
Parameters:
id0  don't list blocks with id < id0
array  pointer to array of pointers to leaked blocks, or NULL
fd  print list of leaks to fd (or NULL)
persistence  make check across all object even persistent ones


Generated on Wed Sep 14 10:43:48 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.2