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

Memory Tracing
[Memory Management Utilities]

Collaboration diagram for Memory Tracing:


Detailed Description

Routines dealing with memory tracing and corruption checking.


Functions

psS32 psMemCheckLeaks (psMemoryId id0, psMemBlock ***arr, FILE *fd, psBool persistence)
 Check for memory leaks.
psS32 psMemCheckCorruption (psBool abort_on_error)
 Check for memory corruption.


Function Documentation

psS32 psMemCheckCorruption psBool  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.

Parameters:
abort_on_error  Abort on detecting corruption?

psS32 psMemCheckLeaks psMemoryId  id0,
psMemBlock ***  arr,
FILE *  fd,
psBool  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.

return psS32 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
arr  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 Jun 15 11:01:15 2005 for Pan-STARRS Foundation Library by  doxygen 1.4.1