Main Page Modules Class Hierarchy Data Structures File List Data Fields Globals Related Pages

# MM_Audit_Imp Class Reference
[OSCL Memory]

`#include <oscl_mem_audit.h>`

## Public Methods
| MM_Audit_Imp ()
| ~MM_Audit_Imp ()
OSCL_IMPORT_REF void * | MM_allocate (const OsclMemStatsNode *statsNode, uint32 sizeIn, const char *pFileName, uint32 lineNumber, bool allocNodeTracking=false)
OSCL_IMPORT_REF bool | MM_deallocate (void *pMemBlockIn)
OSCL_IMPORT_REF MM_Stats_t * | MM_GetStats (const char *const tagIn)
OSCL_IMPORT_REF uint32 | MM_GetStatsInDepth (const char *tagIn, MM_Stats_CB *array_ptr, uint32 max_nodes)
OSCL_IMPORT_REF uint32 | MM_GetTreeNodes (const char *tagIn)
OSCL_IMPORT_REF bool | MM_AddTag (const char *tagIn)
OSCL_IMPORT_REF const OsclMemStatsNode * | MM_GetTagNode (const char *tagIn)
OSCL_IMPORT_REF const OsclMemStatsNode * | MM_GetExistingTag (const char *tagIn)
OSCL_IMPORT_REF const OsclMemStatsNode * | MM_GetRootNode ()
OSCL_IMPORT_REF MM_AllocQueryInfo * | MM_CreateAllocNodeInfo (uint32 max_array_size)
OSCL_IMPORT_REF void | MM_ReleaseAllocNodeInfo (MM_AllocQueryInfo *info)
OSCL_IMPORT_REF uint32 | MM_GetAllocNodeInfo (MM_AllocQueryInfo *output_array, uint32 max_array_size, uint32 offset)
OSCL_IMPORT_REF bool | MM_Validate (const void *ptrIn)
uint32 | MM_GetAllocNo (void)
void | MM_GetOverheadStats (MM_AuditOverheadStats &stats)
uint32 | MM_GetNumAllocNodes ()
uint32 | MM_GetMode (void)
uint8 | MM_GetPrefillPattern (void)
uint32 | MM_GetPostfillPattern (void)
OSCL_IMPORT_REF void | MM_SetMode (uint32 inMode)
OSCL_IMPORT_REF void | MM_SetPrefillPattern (uint8 pattern)
OSCL_IMPORT_REF void | MM_SetPostfillPattern (uint8 pattern)
OSCL_IMPORT_REF void | MM_SetTagLevel (uint32 level)
OSCL_IMPORT_REF bool | MM_SetFailurePoint (const char *tagIn, uint32 alloc_number)
OSCL_IMPORT_REF void | MM_UnsetFailurePoint (const char *tagIn)
MM_AllocNode * | addAllocNode (void *pMem, uint32 sizeIn, OsclMemStatsNode *pStatsNode, const char *pFileName, uint32 lineNumber)
OsclMemStatsNode * | removeAllocNode (void *pMemBlockIn, uint32 &size)
void | removeALLAllocNodes ()
OsclMemStatsNode * | createStatsNode (const char *tagIn)
bool | updateStatsNode (OsclMemStatsNode *pCurrStatsNode, const MM_Stats_t &pDelta, bool bAdd)
bool | updateStatsNodeInFailure (const char *tagIn)
bool | updateStatsNodeInFailure (OsclMemStatsNode *pStatsNode)
bool | pruneSubtree (OsclMemStatsNode *pNode)
bool | pruneSubtree (const char *tagIn)
void | retrieveParentTag (char *tag)
int32 | retrieveParentTagLength (const char *tag, int32 bound)
void | makeValidTag (const char *tagIn, MMAuditCharAutoPtr &autoptr)
uint32 | getTagActualSize (const char *tagIn)
bool | isSetFailure (const char *tagIn)
bool | isSetFailure (OsclMemStatsNode *statsNode)
bool | validate_all_heap ()
## Static Public Methods
bool | validate (void *ptrIn)
OsclMemAudit * | getAuditRoot (void *ptrIn)
uint32 | getSize (void *ptrIn)

## Constructor & Destructor Documentation

MM_Audit_Imp::MM_Audit_Imp | ( |  | ) |

| Constructor, create the root node in statistics table

MM_Audit_Imp::~MM_Audit_Imp | ( |  | ) |

| A destructor, remove all the nodes in allocation andstatistics table

## Member Function Documentation

MM_AllocNode* MM_Audit_Imp::addAllocNode | ( | void * | pMem,
|  | uint32 | sizeIn,
|  | OsclMemStatsNode * | pStatsNode,
|  | const char * | pFileName,
|  | uint32 | lineNumber
| ) |

| Returns: true if operation succeeds;

OsclMemStatsNode* MM_Audit_Imp::createStatsNode | ( | const char * | tagIn | ) |

| Returns: true if operation succeeds;

OsclMemAudit* MM_Audit_Imp::getAuditRoot | ( | void * | ptrIn | ) | `[static]`

| Returns: audit root pointer.

uint32 MM_Audit_Imp::getSize | ( | void * | ptrIn | ) | `[static]`

| Returns: original block size. leaves if bad pointer.

uint32 MM_Audit_Imp::getTagActualSize | ( | const char * | tagIn | ) |

| Returns: the size of the truncated tag; 0 means NO truncation

bool MM_Audit_Imp::isSetFailure | ( | OsclMemStatsNode * | statsNode | ) |

bool MM_Audit_Imp::isSetFailure | ( | const char * | tagIn | ) |

| Returns: true if operation succeeds;

void MM_Audit_Imp::makeValidTag | ( | const char * | tagIn,
|  | MMAuditCharAutoPtr & | autoptr
| ) |

| Returns: a valid tag; NULL will be converted into root tag

OSCL_IMPORT_REF bool MM_Audit_Imp::MM_AddTag | ( | const char * | tagIn | ) | `[inline]`

  | API to add a node and zero out its counters; Note that this tag should be re-used Parameters:
  tagIn | input tag
Returns: true if operation succeeds;

OSCL_IMPORT_REF void* MM_Audit_Imp::MM_allocate | ( | const OsclMemStatsNode * | statsNode,
|  | uint32 | sizeIn,
|  | const char * | pFileName,
|  | uint32 | lineNumber,
|  | bool | allocNodeTracking = false
| ) |

| The following are APIs t __nothrow_/ const __nothrow_ Returns: the memory pointer if operation succeeds.

OSCL_IMPORT_REF MM_AllocQueryInfo* MM_Audit_Imp::MM_CreateAllocNodeInfo | ( | uint32 | max_array_size | ) |

| These APIs will allocate and release space for alloc node info, to be used with the MM_GetAllocNodeInfo API.

OSCL_IMPORT_REF bool MM_Audit_Imp::MM_deallocate | ( | void * | pMemBlockIn | ) |

| Returns: true if operation succeeds;

uint32 MM_Audit_Imp::MM_GetAllocNo | ( | void |  | ) | `[inline]`

| API to get the current allocation number Returns: the current allocation number

OSCL_IMPORT_REF uint32 MM_Audit_Imp::MM_GetAllocNodeInfo | ( | MM_AllocQueryInfo * | output_array,
|  | uint32 | max_array_size,
|  | uint32 | offset
| ) |

  | API to query the list of alloc nodes. It copies the information into the provided output array. Parameters:
  output_array | the array where the data will be written
  max_array_size | the max number of output array elements
  offset | the offset into the alloc node list from which the data should begin.
Returns: the number of valid nodes in the output array

OSCL_IMPORT_REF const OsclMemStatsNode* MM_Audit_Imp::MM_GetExistingTag | ( | const char * | tagIn | ) |

  | API to add a node and zero out its counters; Note that this tag should be re-used Parameters:
  tagIn | input tag
Returns: true if operation succeeds;

uint32 MM_Audit_Imp::MM_GetMode | ( | void |  | ) | `[inline]`

| API to get the operating mode of the mm_audit class.

uint32 MM_Audit_Imp::MM_GetNumAllocNodes | ( |  | ) | `[inline]`

| API to get the number of allocation nodes (records) for allocations that are being tracked individually.

void MM_Audit_Imp::MM_GetOverheadStats | ( | MM_AuditOverheadStats & | stats | ) | `[inline]`

| API to get the overhead statistics for the memory used by the mm_audit class.

uint32 MM_Audit_Imp::MM_GetPostfillPattern | ( | void |  | ) | `[inline]`

| API to get the postfill pattern. The pattern is used to fill the memory before freeing it.

uint8 MM_Audit_Imp::MM_GetPrefillPattern | ( | void |  | ) | `[inline]`

| API to get the prefill pattern. The pattern is used to fill the memory before returning it to the caller.

OSCL_IMPORT_REF const OsclMemStatsNode* MM_Audit_Imp::MM_GetRootNode | ( |  | ) | `[inline]`

OSCL_IMPORT_REF MM_Stats_t* MM_Audit_Imp::MM_GetStats | ( | const char *const | tagIn | ) |

| API to get memory statistics through context string(tag) Returns: statistics pointer if operation succeeds

OSCL_IMPORT_REF uint32 MM_Audit_Imp::MM_GetStatsInDepth | ( | const char * | tagIn,
|  | MM_Stats_CB * | array_ptr,
|  | uint32 | max_nodes
| ) |

| API to get memory statistics in detail through context string(tag) including its subtree Returns: statistics pointer array and actual number of nodes if operation succeeds

OSCL_IMPORT_REF const OsclMemStatsNode* MM_Audit_Imp::MM_GetTagNode | ( | const char * | tagIn | ) |

  | API to add a node and zero out its counters; Note that this tag should be re-used Parameters:
  tagIn | input tag
Returns: pointer to OsclMemStatsNode which should be passed to MM_allocate

OSCL_IMPORT_REF uint32 MM_Audit_Imp::MM_GetTreeNodes | ( | const char * | tagIn | ) |

  | API to get the number of tree nodes including the tag node and its subtree Parameters:
  tagIn | input tag
Returns: the number of tree nodes ; 0 means no tag node

OSCL_IMPORT_REF void MM_Audit_Imp::MM_ReleaseAllocNodeInfo | ( | MM_AllocQueryInfo * | info | ) |

OSCL_IMPORT_REF bool MM_Audit_Imp::MM_SetFailurePoint | ( | const char * | tagIn,
|  | uint32 | alloc_number
| ) |

  | API to insert allocation failure deterministically according to allocation number associated with tag Parameters:
  tagIn | input tag
  alloc_number | allocation number associated with tag
Returns: true if operation succeeds;

OSCL_IMPORT_REF void MM_Audit_Imp::MM_SetMode | ( | uint32 | inMode | ) |

| API to set the operating mode of the mm_audit class.

OSCL_IMPORT_REF void MM_Audit_Imp::MM_SetPostfillPattern | ( | uint8 | pattern | ) |

| API to set the postfill pattern.

OSCL_IMPORT_REF void MM_Audit_Imp::MM_SetPrefillPattern | ( | uint8 | pattern | ) |

| API to set the prefill pattern.

OSCL_IMPORT_REF void MM_Audit_Imp::MM_SetTagLevel | ( | uint32 | level | ) |

  | API to set the maximum tag level,i.e. tag level for a.b.c.d = 4 Parameters:
  level | input tag level to be set

OSCL_IMPORT_REF void MM_Audit_Imp::MM_UnsetFailurePoint | ( | const char * | tagIn | ) |

  | API to cancel the allocation failure point associated with tag Parameters:
  tagIn | input tag

OSCL_IMPORT_REF bool MM_Audit_Imp::MM_Validate | ( | const void * | ptrIn | ) |

  | API to check the input pointer is a valid pointer to a chunk of memory Parameters:
  ptrIn | input pointer to be validated
Returns: true if operation succeeds;

bool MM_Audit_Imp::pruneSubtree | ( | const char * | tagIn | ) |

bool MM_Audit_Imp::pruneSubtree | ( | OsclMemStatsNode * | pNode | ) |

| Returns: true if operation succeeds;

void MM_Audit_Imp::removeALLAllocNodes | ( |  | ) |

OsclMemStatsNode* MM_Audit_Imp::removeAllocNode | ( | void * | pMemBlockIn,
|  | uint32 & | size
| ) |

| Returns: true if operation succeeds;

void MM_Audit_Imp::retrieveParentTag | ( | char * | tag | ) |

int32 MM_Audit_Imp::retrieveParentTagLength | ( | const char * | tag,
|  | int32 | bound
| ) |

| Returns: the length of a immediate parent tag for the input tag

bool MM_Audit_Imp::updateStatsNode | ( | OsclMemStatsNode * | pCurrStatsNode,
|  | const MM_Stats_t & | pDelta,
|  | bool | bAdd
| ) |

| Returns: true if operation succeeds;

bool MM_Audit_Imp::updateStatsNodeInFailure | ( | OsclMemStatsNode * | pStatsNode | ) |

bool MM_Audit_Imp::updateStatsNodeInFailure | ( | const char * | tagIn | ) |

| Returns: true if operation succeeds;

bool MM_Audit_Imp::validate | ( | void * | ptrIn | ) | `[static]`

| Returns: true if operation succeeds;

bool MM_Audit_Imp::validate_all_heap | ( |  | ) |

| Returns: true if operation succeeds;

The documentation for this class was generated from the following file:

- oscl_mem_audit.h