1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"> 3<title>oscl_mem_audit.h Source File</title> 4<link href="doxygen.css" rel="stylesheet" type="text/css"> 5</head><body> 6<!-- Generated by Doxygen 1.2.18 --> 7<center> 8<a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="modules.html">Modules</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> <a class="qindex" href="globals.html">Globals</a> </center> 9<hr><h1>oscl_mem_audit.h</h1><a href="oscl__mem__audit_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">// -*- c++ -*-</span> 1000002 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 1100003 1200004 <span class="comment">// O S C L _ M E M _ A U D I T</span> 1300005 1400006 <span class="comment">// = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =</span> 1500007 1600018 <span class="preprocessor">#ifndef OSCL_MEM_AUDIT_H_INCLUDED</span> 1700019 <span class="preprocessor"></span><span class="preprocessor">#define OSCL_MEM_AUDIT_H_INCLUDED</span> 1800020 <span class="preprocessor"></span> 1900021 <span class="preprocessor">#ifndef OSCL_LOCK_BASE_H_INCLUDED</span> 2000022 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__lock__base_8h.html">oscl_lock_base.h</a>"</span> 2100023 <span class="preprocessor">#endif</span> 2200024 <span class="preprocessor"></span> 2300025 <span class="preprocessor">#ifndef OSCL_BASE_ALLOC_H_INCLUDED</span> 2400026 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__base__alloc_8h.html">oscl_base_alloc.h</a>"</span> 2500027 <span class="preprocessor">#endif</span> 2600028 <span class="preprocessor"></span> 2700029 <span class="preprocessor">#ifndef OSCL_TAGTREE_H_INCLUDED</span> 2800030 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__tagtree_8h.html">oscl_tagtree.h</a>"</span> 2900031 <span class="preprocessor">#endif</span> 3000032 <span class="preprocessor"></span> 3100033 <span class="preprocessor">#ifndef OSCL_MEM_H_INCLUDED</span> 3200034 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mem_8h.html">oscl_mem.h</a>"</span> 3300035 <span class="preprocessor">#endif</span> 3400036 <span class="preprocessor"></span> 3500037 <span class="preprocessor">#ifndef OSCL_MEM_AUTO_PTR_H_INCLUDED</span> 3600038 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="oscl__mem__auto__ptr_8h.html">oscl_mem_auto_ptr.h</a>"</span> 3700039 <span class="preprocessor">#endif</span> 3800040 <span class="preprocessor"></span> 39<a name="l00041"></a><a class="code" href="oscl__mem__audit_8h.html#a0">00041</a> <span class="preprocessor">#define OSCL_DISABLE_WARNING_TRUNCATE_DEBUG_MESSAGE</span> 4000042 <span class="preprocessor"></span><span class="preprocessor">#include "<a class="code" href="osclconfig__compiler__warnings_8h.html">osclconfig_compiler_warnings.h</a>"</span> 4100043 4200044 4300045 <span class="comment">/* DATA TYPES */</span> 44<a name="l00046"></a><a class="code" href="structMM__Stats__t.html">00046</a> <span class="keyword">struct </span><a class="code" href="structMM__Stats__t.html">MM_Stats_t</a> 4500047 { 46<a name="l00048"></a><a class="code" href="structMM__Stats__t.html#m0">00048</a> uint32 <a class="code" href="structMM__Stats__t.html#m0">numBytes</a>; 47<a name="l00049"></a><a class="code" href="structMM__Stats__t.html#m1">00049</a> uint32 <a class="code" href="structMM__Stats__t.html#m1">peakNumBytes</a>; 48<a name="l00050"></a><a class="code" href="structMM__Stats__t.html#m2">00050</a> uint32 <a class="code" href="structMM__Stats__t.html#m2">numAllocs</a>; 49<a name="l00051"></a><a class="code" href="structMM__Stats__t.html#m3">00051</a> uint32 <a class="code" href="structMM__Stats__t.html#m3">peakNumAllocs</a>; 50<a name="l00052"></a><a class="code" href="structMM__Stats__t.html#m4">00052</a> uint32 <a class="code" href="structMM__Stats__t.html#m4">numAllocFails</a>; 51<a name="l00053"></a><a class="code" href="structMM__Stats__t.html#m5">00053</a> uint32 <a class="code" href="structMM__Stats__t.html#m5">totalNumAllocs</a>; 52<a name="l00054"></a><a class="code" href="structMM__Stats__t.html#m6">00054</a> uint32 <a class="code" href="structMM__Stats__t.html#m6">totalNumBytes</a>; 5300055 54<a name="l00056"></a><a class="code" href="structMM__Stats__t.html#a0">00056</a> <a class="code" href="structMM__Stats__t.html#a0">MM_Stats_t</a>() 5500057 { 5600058 <a class="code" href="group__osclmemory.html#a14">oscl_memset</a>(<span class="keyword">this</span>, 0, <span class="keyword">sizeof</span>(<a class="code" href="structMM__Stats__t.html">MM_Stats_t</a>)); 5700059 }; 58<a name="l00060"></a><a class="code" href="structMM__Stats__t.html#a1">00060</a> <a class="code" href="structMM__Stats__t.html#a0">MM_Stats_t</a>(uint32 sizeIn) 5900061 { 6000062 <a class="code" href="structMM__Stats__t.html#m0">numBytes</a> = <a class="code" href="structMM__Stats__t.html#m1">peakNumBytes</a> = sizeIn; 6100063 <a class="code" href="structMM__Stats__t.html#m3">peakNumAllocs</a> = <a class="code" href="structMM__Stats__t.html#m2">numAllocs</a> = 1; 6200064 <a class="code" href="structMM__Stats__t.html#m4">numAllocFails</a> = 0; 6300065 <a class="code" href="structMM__Stats__t.html#m5">totalNumAllocs</a> = 1; 6400066 <a class="code" href="structMM__Stats__t.html#m6">totalNumBytes</a> = sizeIn; 6500067 }; 6600068 67<a name="l00069"></a><a class="code" href="structMM__Stats__t.html#a2">00069</a> <span class="keywordtype">void</span> <a class="code" href="structMM__Stats__t.html#a2">reset</a>() 6800070 { 6900071 <a class="code" href="group__osclmemory.html#a14">oscl_memset</a>(<span class="keyword">this</span>, 0, <span class="keyword">sizeof</span>(<a class="code" href="structMM__Stats__t.html">MM_Stats_t</a>)); 7000072 }; 7100073 72<a name="l00074"></a><a class="code" href="structMM__Stats__t.html#a3">00074</a> <span class="keywordtype">void</span> <a class="code" href="structMM__Stats__t.html#a3">update</a>(<span class="keyword">const</span> <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a>& delta, <span class="keywordtype">bool</span> add) 7300075 { 7400076 <span class="keywordflow">if</span> (add) 7500077 { 7600078 <a class="code" href="structMM__Stats__t.html#m0">numBytes</a> += delta.<a class="code" href="structMM__Stats__t.html#m0">numBytes</a>; 7700079 <a class="code" href="structMM__Stats__t.html#m2">numAllocs</a> += delta.<a class="code" href="structMM__Stats__t.html#m2">numAllocs</a>; 7800080 <a class="code" href="structMM__Stats__t.html#m4">numAllocFails</a> += delta.<a class="code" href="structMM__Stats__t.html#m4">numAllocFails</a>; 7900081 <span class="keywordflow">if</span> (<a class="code" href="structMM__Stats__t.html#m0">numBytes</a> > <a class="code" href="structMM__Stats__t.html#m1">peakNumBytes</a>) 8000082 { 8100083 <a class="code" href="structMM__Stats__t.html#m1">peakNumBytes</a> = <a class="code" href="structMM__Stats__t.html#m0">numBytes</a>; 8200084 } 8300085 <span class="keywordflow">if</span> (<a class="code" href="structMM__Stats__t.html#m2">numAllocs</a> > <a class="code" href="structMM__Stats__t.html#m3">peakNumAllocs</a>) 8400086 { 8500087 <a class="code" href="structMM__Stats__t.html#m3">peakNumAllocs</a> = <a class="code" href="structMM__Stats__t.html#m2">numAllocs</a>; 8600088 } 8700089 8800090 <a class="code" href="structMM__Stats__t.html#m5">totalNumAllocs</a> += delta.<a class="code" href="structMM__Stats__t.html#m2">numAllocs</a>; 8900091 <a class="code" href="structMM__Stats__t.html#m6">totalNumBytes</a> += delta.<a class="code" href="structMM__Stats__t.html#m0">numBytes</a>; 9000092 9100093 } 9200094 <span class="keywordflow">else</span> 9300095 { 9400096 <a class="code" href="structMM__Stats__t.html#m0">numBytes</a> -= delta.<a class="code" href="structMM__Stats__t.html#m0">numBytes</a>; 9500097 <a class="code" href="structMM__Stats__t.html#m2">numAllocs</a> -= delta.<a class="code" href="structMM__Stats__t.html#m2">numAllocs</a>; 9600098 <a class="code" href="structMM__Stats__t.html#m4">numAllocFails</a> -= delta.<a class="code" href="structMM__Stats__t.html#m4">numAllocFails</a>; 9700099 } 9800100 } 9900101 100<a name="l00102"></a><a class="code" href="structMM__Stats__t.html#a4">00102</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__Stats__t.html#a4">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size) 10100103 { 10200104 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 10300105 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_Stats_t, OsclMemBasicAllocator></a> statsAlloc; 10400106 <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a> *ptr = statsAlloc.<a class="code" href="classOscl__TAlloc.html#a2">allocate</a>(1); 10500107 <span class="keywordflow">return</span> ptr; 10600108 }; 10700109 108<a name="l00110"></a><a class="code" href="structMM__Stats__t.html#a5">00110</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__Stats__t.html#a4">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size, <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a>* ptr) 10900111 { 11000112 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 11100113 <span class="keywordflow">return</span> ptr; 11200114 }; 11300115 11400116 115<a name="l00117"></a><a class="code" href="structMM__Stats__t.html#a6">00117</a> <span class="keywordtype">void</span> <a class="code" href="structMM__Stats__t.html#a6">operator delete</a>(<span class="keywordtype">void</span> *ptr) <span class="keywordflow">throw</span>() 11600118 { 11700119 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_Stats_t, OsclMemBasicAllocator></a> statsAlloc; 11800120 statsAlloc.<a class="code" href="classOscl__TAlloc.html#a5">deallocate</a>((<a class="code" href="structMM__Stats__t.html">MM_Stats_t</a>*)ptr); 11900121 }; 12000122 12100123 <span class="comment">/* won't build on ADS</span> 12200124 <span class="comment"> void operator delete(void *ptr, MM_Stats_t* mptr) {</span> 12300125 <span class="comment"> OSCL_UNUSED_ARG(ptr);</span> 12400126 <span class="comment"> OSCL_UNUSED_ARG(mptr);</span> 12500127 <span class="comment"> };</span> 12600128 <span class="comment"> */</span> 12700129 }; 12800130 129<a name="l00131"></a><a class="code" href="structMM__FailInsertParam.html">00131</a> <span class="keyword">struct </span><a class="code" href="structMM__FailInsertParam.html">MM_FailInsertParam</a> 13000132 { 131<a name="l00133"></a><a class="code" href="structMM__FailInsertParam.html#m0">00133</a> uint32 <a class="code" href="structMM__FailInsertParam.html#m0">nAllocNum</a>; 132<a name="l00134"></a><a class="code" href="structMM__FailInsertParam.html#m1">00134</a> uint16 <a class="code" href="structMM__FailInsertParam.html#m1">xsubi</a>[3]; 133<a name="l00135"></a><a class="code" href="structMM__FailInsertParam.html#a0">00135</a> <a class="code" href="structMM__FailInsertParam.html#a0">MM_FailInsertParam</a>(): <a class="code" href="structMM__FailInsertParam.html#m0">nAllocNum</a>(0) 13400136 { 13500137 <a class="code" href="group__osclmemory.html#a14">oscl_memset</a>(<a class="code" href="structMM__FailInsertParam.html#m1">xsubi</a>, 0, 3*<span class="keyword">sizeof</span>(<a class="code" href="structMM__FailInsertParam.html#m1">xsubi</a>[0])); 13600138 } 13700139 138<a name="l00140"></a><a class="code" href="structMM__FailInsertParam.html#a1">00140</a> <span class="keywordtype">void</span> <a class="code" href="structMM__FailInsertParam.html#a1">reset</a>() 13900141 { 14000142 <a class="code" href="structMM__FailInsertParam.html#m0">nAllocNum</a> = 0; 14100143 <a class="code" href="group__osclmemory.html#a14">oscl_memset</a>(<a class="code" href="structMM__FailInsertParam.html#m1">xsubi</a>, 0, 3*<span class="keyword">sizeof</span>(<a class="code" href="structMM__FailInsertParam.html#m1">xsubi</a>[0])); 14200144 }; 14300145 144<a name="l00146"></a><a class="code" href="structMM__FailInsertParam.html#a2">00146</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__FailInsertParam.html#a2">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size) 14500147 { 14600148 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 14700149 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_FailInsertParam, OsclMemBasicAllocator></a> failAlloc; 14800150 <a class="code" href="structMM__FailInsertParam.html">MM_FailInsertParam</a> *ptr = failAlloc.<a class="code" href="classOscl__TAlloc.html#a2">allocate</a>(1); 14900151 <span class="keywordflow">return</span> ptr; 15000152 }; 15100153 152<a name="l00154"></a><a class="code" href="structMM__FailInsertParam.html#a3">00154</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__FailInsertParam.html#a2">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size, <a class="code" href="structMM__FailInsertParam.html">MM_FailInsertParam</a>* ptr) 15300155 { 15400156 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 15500157 <span class="keywordflow">return</span> ptr; 15600158 }; 15700159 15800160 159<a name="l00161"></a><a class="code" href="structMM__FailInsertParam.html#a4">00161</a> <span class="keywordtype">void</span> <a class="code" href="structMM__FailInsertParam.html#a4">operator delete</a>(<span class="keywordtype">void</span> *ptr) <span class="keywordflow">throw</span>() 16000162 { 16100163 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_FailInsertParam, OsclMemBasicAllocator></a> failAlloc; 16200164 failAlloc.<a class="code" href="classOscl__TAlloc.html#a5">deallocate</a>((<a class="code" href="structMM__FailInsertParam.html">MM_FailInsertParam</a>*)ptr); 16300165 }; 16400166 16500167 <span class="comment">/* won't build on ADS</span> 16600168 <span class="comment"> void operator delete(void *ptr, MM_FailInsertParam* mptr) {</span> 16700169 <span class="comment"> OSCL_UNUSED_ARG(ptr);</span> 16800170 <span class="comment"> OSCL_UNUSED_ARG(mptr);</span> 16900171 <span class="comment"> };*/</span> 17000172 }; 17100173 172<a name="l00174"></a><a class="code" href="classOsclMemStatsNode.html">00174</a> <span class="keyword">class </span><a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> 17300175 { 17400176 <span class="keyword">public</span>: 17500177 176<a name="l00178"></a><a class="code" href="classOsclMemStatsNode.html#m0">00178</a> <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a> *<a class="code" href="classOsclMemStatsNode.html#m0">pMMStats</a>; 177<a name="l00179"></a><a class="code" href="classOsclMemStatsNode.html#m1">00179</a> <a class="code" href="structMM__FailInsertParam.html">MM_FailInsertParam</a> *<a class="code" href="classOsclMemStatsNode.html#m1">pMMFIParam</a>; 17800180 17900181 <span class="comment">/* set a link to map, especially for getting the tags of children nodes */</span> 180<a name="l00182"></a><a class="code" href="classOsclMemStatsNode.html#m2">00182</a> <span class="keywordtype">char</span> *<a class="code" href="classOsclMemStatsNode.html#m2">tag</a>; 18100183 182<a name="l00184"></a><a class="code" href="classOsclMemStatsNode.html#a0">00184</a> <a class="code" href="classOsclMemStatsNode.html#a0">OsclMemStatsNode</a>() 18300185 { 18400186 pMMStats = <a class="code" href="group__osclbase.html#a81">NULL</a>; 18500187 pMMFIParam = <a class="code" href="group__osclbase.html#a81">NULL</a>; 18600188 <a class="code" href="classOsclMemStatsNode.html#m2">tag</a> = <a class="code" href="group__osclbase.html#a81">NULL</a>; 18700189 } 18800190 189<a name="l00191"></a><a class="code" href="classOsclMemStatsNode.html#a1">00191</a> <span class="keywordtype">void</span> <a class="code" href="classOsclMemStatsNode.html#a1">reset</a>() 19000192 { 19100193 <span class="keywordflow">if</span> (pMMStats) pMMStats-><a class="code" href="structMM__Stats__t.html#a2">reset</a>(); 19200194 <span class="keywordflow">if</span> (pMMFIParam) pMMFIParam-><a class="code" href="structMM__FailInsertParam.html#a1">reset</a>(); 19300195 }; 19400196 195<a name="l00197"></a><a class="code" href="classOsclMemStatsNode.html#a2">00197</a> <a class="code" href="classOsclMemStatsNode.html#a2">~OsclMemStatsNode</a>() 19600198 { 19700199 <a class="code" href="group__osclmemory.html#a57">OSCL_DELETE</a>(pMMStats); 19800200 <a class="code" href="group__osclmemory.html#a57">OSCL_DELETE</a>(pMMFIParam); 19900201 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<char, OsclMemBasicAllocator></a> charAlloc; 20000202 charAlloc.<a class="code" href="classOscl__TAlloc.html#a5">deallocate</a>(<a class="code" href="classOsclMemStatsNode.html#m2">tag</a>); 20100203 } 20200204 203<a name="l00205"></a><a class="code" href="classOsclMemStatsNode.html#a3">00205</a> <span class="keywordtype">void</span> *<a class="code" href="classOsclMemStatsNode.html#a3">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size) 20400206 { 20500207 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 20600208 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<OsclMemStatsNode, OsclMemBasicAllocator></a> statsNodeAlloc; 20700209 <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> *ptr = statsNodeAlloc.<a class="code" href="classOscl__TAlloc.html#a2">allocate</a>(1); 20800210 <span class="keywordflow">return</span> ptr; 20900211 }; 21000212 211<a name="l00213"></a><a class="code" href="classOsclMemStatsNode.html#a4">00213</a> <span class="keywordtype">void</span> *<a class="code" href="classOsclMemStatsNode.html#a3">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size, <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* ptr) 21200214 { 21300215 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 21400216 <span class="keywordflow">return</span> ptr; 21500217 }; 21600218 21700219 218<a name="l00220"></a><a class="code" href="classOsclMemStatsNode.html#a5">00220</a> <span class="keywordtype">void</span> <a class="code" href="classOsclMemStatsNode.html#a5">operator delete</a>(<span class="keywordtype">void</span> *ptr) <span class="keywordflow">throw</span>() 21900221 { 22000222 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<OsclMemStatsNode, OsclMemBasicAllocator></a> statsNodeAlloc; 22100223 statsNodeAlloc.<a class="code" href="classOscl__TAlloc.html#a5">deallocate</a>((<a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>*)ptr); 22200224 }; 22300225 22400226 <span class="comment">/* won't build on ADS</span> 22500227 <span class="comment"> void operator delete(void *ptr, OsclMemStatsNode* mptr) {</span> 22600228 <span class="comment"> OSCL_UNUSED_ARG(ptr);</span> 22700229 <span class="comment"> OSCL_UNUSED_ARG(mptr);</span> 22800230 <span class="comment"> };*/</span> 22900231 }; 23000232 231<a name="l00233"></a><a class="code" href="structMM__Stats__CB.html">00233</a> <span class="keyword">struct </span><a class="code" href="structMM__Stats__CB.html">MM_Stats_CB</a> 23200234 { 233<a name="l00235"></a><a class="code" href="structMM__Stats__CB.html#m0">00235</a> <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="structMM__Stats__CB.html#m0">tag</a>; 234<a name="l00236"></a><a class="code" href="structMM__Stats__CB.html#m1">00236</a> <span class="keyword">const</span> <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a> *<a class="code" href="structMM__Stats__CB.html#m1">pStats</a>; 235<a name="l00237"></a><a class="code" href="structMM__Stats__CB.html#m2">00237</a> uint32 <a class="code" href="structMM__Stats__CB.html#m2">num_child_nodes</a>; 23600238 237<a name="l00239"></a><a class="code" href="structMM__Stats__CB.html#a0">00239</a> <a class="code" href="structMM__Stats__CB.html#a0">MM_Stats_CB</a>() 23800240 { 23900241 <a class="code" href="group__osclmemory.html#a14">oscl_memset</a>(<span class="keyword">this</span>, 0, <span class="keyword">sizeof</span>(<a class="code" href="structMM__Stats__CB.html">MM_Stats_CB</a>)); 24000242 } 24100243 242<a name="l00244"></a><a class="code" href="structMM__Stats__CB.html#a1">00244</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__Stats__CB.html#a1">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size) 24300245 { 24400246 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 24500247 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_Stats_CB, OsclMemBasicAllocator></a> statsCBAlloc; 24600248 <a class="code" href="structMM__Stats__CB.html">MM_Stats_CB</a> *ptr = statsCBAlloc.<a class="code" href="classOscl__TAlloc.html#a2">allocate</a>(1); 24700249 <span class="keywordflow">return</span> ptr; 24800250 }; 24900251 250<a name="l00252"></a><a class="code" href="structMM__Stats__CB.html#a2">00252</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__Stats__CB.html#a1">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size, <a class="code" href="structMM__Stats__CB.html">MM_Stats_CB</a>* ptr) 25100253 { 25200254 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 25300255 <span class="keywordflow">return</span> ptr; 25400256 }; 25500257 25600258 257<a name="l00259"></a><a class="code" href="structMM__Stats__CB.html#a3">00259</a> <span class="keywordtype">void</span> <a class="code" href="structMM__Stats__CB.html#a3">operator delete</a>(<span class="keywordtype">void</span> *ptr) <span class="keywordflow">throw</span>() 25800260 { 25900261 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_Stats_CB, OsclMemBasicAllocator></a> statsCBAlloc; 26000262 statsCBAlloc.<a class="code" href="classOscl__TAlloc.html#a5">deallocate</a>((<a class="code" href="structMM__Stats__CB.html">MM_Stats_CB</a>*)ptr); 26100263 }; 26200264 26300265 <span class="comment">/* won't build on ADS</span> 26400266 <span class="comment"> void operator delete(void *ptr, MM_Stats_CB* mptr) {</span> 26500267 <span class="comment"> OSCL_UNUSED_ARG(ptr);</span> 26600268 <span class="comment"> OSCL_UNUSED_ARG(mptr);</span> 26700269 <span class="comment"> };*/</span> 26800270 }; 26900271 270<a name="l00272"></a><a class="code" href="group__osclmemory.html#a63">00272</a> <span class="preprocessor">#define MM_ALLOC_MAX_QUERY_FILENAME_LEN 128</span> 271<a name="l00273"></a><a class="code" href="group__osclmemory.html#a64">00273</a> <span class="preprocessor"></span><span class="preprocessor">#define MM_ALLOC_MAX_QUERY_TAG_LEN 64</span> 27200274 <span class="preprocessor"></span> 273<a name="l00275"></a><a class="code" href="structMM__AllocQueryInfo.html">00275</a> <span class="keyword">struct </span><a class="code" href="structMM__AllocQueryInfo.html">MM_AllocQueryInfo</a> 27400276 { 275<a name="l00277"></a><a class="code" href="structMM__AllocQueryInfo.html#m0">00277</a> uint32 <a class="code" href="structMM__AllocQueryInfo.html#m0">allocNum</a>; 276<a name="l00278"></a><a class="code" href="structMM__AllocQueryInfo.html#m1">00278</a> <span class="keywordtype">char</span> <a class="code" href="structMM__AllocQueryInfo.html#m1">fileName</a>[<a class="code" href="group__osclmemory.html#a63">MM_ALLOC_MAX_QUERY_FILENAME_LEN</a>]; 277<a name="l00279"></a><a class="code" href="structMM__AllocQueryInfo.html#m2">00279</a> uint32 <a class="code" href="structMM__AllocQueryInfo.html#m2">lineNo</a>; 278<a name="l00280"></a><a class="code" href="structMM__AllocQueryInfo.html#m3">00280</a> uint32 <a class="code" href="structMM__AllocQueryInfo.html#m3">size</a>; 279<a name="l00281"></a><a class="code" href="structMM__AllocQueryInfo.html#m4">00281</a> <span class="keyword">const</span> <span class="keywordtype">void</span> *<a class="code" href="structMM__AllocQueryInfo.html#m4">pMemBlock</a>; 280<a name="l00282"></a><a class="code" href="structMM__AllocQueryInfo.html#m5">00282</a> <span class="keywordtype">char</span> <a class="code" href="structMM__AllocQueryInfo.html#m5">tag</a>[<a class="code" href="group__osclmemory.html#a64">MM_ALLOC_MAX_QUERY_TAG_LEN</a>]; 28100283 }; 28200284 28300285 284<a name="l00286"></a><a class="code" href="structMM__AllocInfo.html">00286</a> <span class="keyword">struct </span><a class="code" href="structMM__AllocInfo.html">MM_AllocInfo</a> 28500287 { 286<a name="l00288"></a><a class="code" href="structMM__AllocInfo.html#m0">00288</a> uint32 <a class="code" href="structMM__AllocInfo.html#m0">allocNum</a>; 287<a name="l00289"></a><a class="code" href="structMM__AllocInfo.html#m1">00289</a> <span class="keywordtype">char</span> *<a class="code" href="structMM__AllocInfo.html#m1">pFileName</a>; 288<a name="l00290"></a><a class="code" href="structMM__AllocInfo.html#m2">00290</a> uint32 <a class="code" href="structMM__AllocInfo.html#m2">lineNo</a>; 289<a name="l00291"></a><a class="code" href="structMM__AllocInfo.html#m3">00291</a> uint32 <a class="code" href="structMM__AllocInfo.html#m3">size</a>; 290<a name="l00292"></a><a class="code" href="structMM__AllocInfo.html#m4">00292</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__AllocInfo.html#m4">pMemBlock</a>; 291<a name="l00293"></a><a class="code" href="structMM__AllocInfo.html#m5">00293</a> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> *<a class="code" href="structMM__AllocInfo.html#m5">pStatsNode</a>; 292<a name="l00294"></a><a class="code" href="structMM__AllocInfo.html#m6">00294</a> <span class="keywordtype">bool</span> <a class="code" href="structMM__AllocInfo.html#m6">bSetFailure</a>; 29300295 294<a name="l00296"></a><a class="code" href="structMM__AllocInfo.html#a0">00296</a> <a class="code" href="structMM__AllocInfo.html#a0">MM_AllocInfo</a>() 29500297 { 29600298 <a class="code" href="group__osclmemory.html#a14">oscl_memset</a>(<span class="keyword">this</span>, 0, <span class="keyword">sizeof</span>(<a class="code" href="structMM__AllocInfo.html">MM_AllocInfo</a>)); 29700299 } 29800300 299<a name="l00301"></a><a class="code" href="structMM__AllocInfo.html#a1">00301</a> <a class="code" href="structMM__AllocInfo.html#a1">~MM_AllocInfo</a>() 30000302 { 30100303 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<char, OsclMemBasicAllocator></a> charAlloc; 30200304 charAlloc.<a class="code" href="classOscl__TAlloc.html#a5">deallocate</a>(<a class="code" href="structMM__AllocInfo.html#m1">pFileName</a>); 30300305 } 30400306 30500307 306<a name="l00308"></a><a class="code" href="structMM__AllocInfo.html#a2">00308</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__AllocInfo.html#a2">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> <a class="code" href="structMM__AllocInfo.html#m3">size</a>) 30700309 { 30800310 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(<a class="code" href="structMM__AllocInfo.html#m3">size</a>); 30900311 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_AllocInfo, OsclMemBasicAllocator></a> allocInfoAlloc; 31000312 <a class="code" href="structMM__AllocInfo.html">MM_AllocInfo</a> *ptr = allocInfoAlloc.<a class="code" href="classOscl__TAlloc.html#a2">allocate</a>(1); 31100313 <span class="keywordflow">return</span> ptr; 31200314 }; 31300315 314<a name="l00316"></a><a class="code" href="structMM__AllocInfo.html#a3">00316</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__AllocInfo.html#a2">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> <a class="code" href="structMM__AllocInfo.html#m3">size</a>, <a class="code" href="structMM__AllocInfo.html">MM_AllocInfo</a>* ptr) 31500317 { 31600318 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(<a class="code" href="structMM__AllocInfo.html#m3">size</a>); 31700319 <span class="keywordflow">return</span> ptr; 31800320 }; 31900321 32000322 321<a name="l00323"></a><a class="code" href="structMM__AllocInfo.html#a4">00323</a> <span class="keywordtype">void</span> <a class="code" href="structMM__AllocInfo.html#a4">operator delete</a>(<span class="keywordtype">void</span> *ptr) <span class="keywordflow">throw</span>() 32200324 { 32300325 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_AllocInfo, OsclMemBasicAllocator></a> allocInfoAlloc; 32400326 allocInfoAlloc.<a class="code" href="classOscl__TAlloc.html#a5">deallocate</a>((<a class="code" href="structMM__AllocInfo.html">MM_AllocInfo</a>*)ptr); 32500327 }; 32600328 32700329 <span class="comment">/* won't build on ADS</span> 32800330 <span class="comment"> void operator delete(void *ptr, MM_AllocInfo* mptr) {</span> 32900331 <span class="comment"> OSCL_UNUSED_ARG(ptr);</span> 33000332 <span class="comment"> OSCL_UNUSED_ARG(mptr);</span> 33100333 <span class="comment"> };*/</span> 33200334 }; 33300335 33400336 335<a name="l00337"></a><a class="code" href="structMM__AllocNode.html">00337</a> <span class="keyword">struct </span><a class="code" href="structMM__AllocNode.html">MM_AllocNode</a> 33600338 { 337<a name="l00339"></a><a class="code" href="structMM__AllocNode.html#m0">00339</a> <a class="code" href="structMM__AllocInfo.html">MM_AllocInfo</a> *<a class="code" href="structMM__AllocNode.html#m0">pAllocInfo</a>; 33800340 339<a name="l00341"></a><a class="code" href="structMM__AllocNode.html#m1">00341</a> <a class="code" href="structMM__AllocNode.html">MM_AllocNode</a> *<a class="code" href="structMM__AllocNode.html#m1">pPrev</a>; 340<a name="l00342"></a><a class="code" href="structMM__AllocNode.html#m2">00342</a> <a class="code" href="structMM__AllocNode.html">MM_AllocNode</a> *<a class="code" href="structMM__AllocNode.html#m2">pNext</a>; 341<a name="l00343"></a><a class="code" href="structMM__AllocNode.html#a0">00343</a> <a class="code" href="structMM__AllocNode.html#a0">MM_AllocNode</a>() 34200344 { 34300345 <a class="code" href="group__osclmemory.html#a14">oscl_memset</a>(<span class="keyword">this</span>, 0, <span class="keyword">sizeof</span>(<a class="code" href="structMM__AllocNode.html">MM_AllocNode</a>)); 34400346 } 34500347 346<a name="l00348"></a><a class="code" href="structMM__AllocNode.html#a1">00348</a> <a class="code" href="structMM__AllocNode.html#a1">~MM_AllocNode</a>() 34700349 { 34800350 <a class="code" href="group__osclmemory.html#a57">OSCL_DELETE</a>(pAllocInfo); 34900351 } 35000352 351<a name="l00353"></a><a class="code" href="structMM__AllocNode.html#a2">00353</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__AllocNode.html#a2">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size) 35200354 { 35300355 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 35400356 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_AllocNode, OsclMemBasicAllocator></a> allocNodeAlloc; 35500357 <a class="code" href="structMM__AllocNode.html">MM_AllocNode</a> *ptr = allocNodeAlloc.<a class="code" href="classOscl__TAlloc.html#a2">allocate</a>(1); 35600358 <span class="keywordflow">return</span> ptr; 35700359 }; 35800360 359<a name="l00361"></a><a class="code" href="structMM__AllocNode.html#a3">00361</a> <span class="keywordtype">void</span> *<a class="code" href="structMM__AllocNode.html#a2">operator new</a>(<a class="code" href="osclconfig__ansi__memory_8h.html#a1">oscl_memsize_t</a> size, <a class="code" href="structMM__AllocNode.html">MM_AllocNode</a>* ptr) 36000362 { 36100363 <a class="code" href="group__osclbase.html#a89">OSCL_UNUSED_ARG</a>(size); 36200364 <span class="keywordflow">return</span> ptr; 36300365 }; 36400366 36500367 366<a name="l00368"></a><a class="code" href="structMM__AllocNode.html#a4">00368</a> <span class="keywordtype">void</span> <a class="code" href="structMM__AllocNode.html#a4">operator delete</a>(<span class="keywordtype">void</span> *ptr) <span class="keywordflow">throw</span>() 36700369 { 36800370 <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_AllocNode, OsclMemBasicAllocator></a> allocNodeAlloc; 36900371 allocNodeAlloc.<a class="code" href="classOscl__TAlloc.html#a5">deallocate</a>((<a class="code" href="structMM__AllocNode.html">MM_AllocNode</a>*)ptr); 37000372 }; 37100373 37200374 <span class="comment">/* won't build on ADS</span> 37300375 <span class="comment"> void operator delete(void *ptr, MM_AllocNode* mptr) {</span> 37400376 <span class="comment"> OSCL_UNUSED_ARG(ptr);</span> 37500377 <span class="comment"> OSCL_UNUSED_ARG(mptr);</span> 37600378 <span class="comment"> };*/</span> 37700379 }; 37800380 37900381 38000382 <span class="comment">/* Define internal auto ptr classes that don't go through mem mgmt */</span> 381<a name="l00383"></a><a class="code" href="group__osclmemory.html#a0">00383</a> <span class="keyword">typedef</span> <a class="code" href="classOSCLMemAutoPtr.html">OSCLMemAutoPtr<char, Oscl_TAlloc<char, OsclMemBasicAllocator></a> > <a class="code" href="classOSCLMemAutoPtr.html">MMAuditCharAutoPtr</a>; 382<a name="l00384"></a><a class="code" href="group__osclmemory.html#a1">00384</a> <span class="keyword">typedef</span> <a class="code" href="classOSCLMemAutoPtr.html">OSCLMemAutoPtr<uint8, Oscl_TAlloc<uint8, _OsclBasicAllocator></a> > <a class="code" href="classOSCLMemAutoPtr.html">MMAuditUint8AutoPtr</a>; 383<a name="l00385"></a><a class="code" href="group__osclmemory.html#a2">00385</a> <span class="keyword">typedef</span> <a class="code" href="classOSCLMemAutoPtr.html">OSCLMemAutoPtr<MM_AllocNode, Oscl_TAlloc<MM_AllocNode, OsclMemBasicAllocator></a> > <a class="code" href="classOSCLMemAutoPtr.html">MM_AllocNodeAutoPtr</a>; 38400386 385<a name="l00387"></a><a class="code" href="group__osclmemory.html#a3">00387</a> <span class="keyword">typedef</span> <a class="code" href="classOSCLMemAutoPtr.html">OSCLMemAutoPtr<OsclMemStatsNode, Oscl_TAlloc<OsclMemStatsNode, OsclMemBasicAllocator></a> > <a class="code" href="classOSCLMemAutoPtr.html">MM_StatsNodeTagTreeType</a>; 386<a name="l00388"></a><a class="code" href="group__osclmemory.html#a4">00388</a> <span class="keyword">typedef</span> <a class="code" href="classOSCLMemAutoPtr.html">OSCLMemAutoPtr<OsclMemStatsNode, Oscl_TAlloc<OsclMemStatsNode, OsclMemBasicAllocator></a> > <a class="code" href="classOSCLMemAutoPtr.html">OsclMemStatsNodeAutoPtr</a>; 387<a name="l00389"></a><a class="code" href="group__osclmemory.html#a5">00389</a> <span class="keyword">typedef</span> <a class="code" href="classOscl__TAlloc.html">Oscl_TAlloc<MM_StatsNodeTagTreeType, OsclMemBasicAllocator></a> <a class="code" href="classOscl__TAlloc.html">TagTree_Allocator</a>; 388<a name="l00390"></a><a class="code" href="group__osclmemory.html#a6">00390</a> <span class="keyword">typedef</span> <a class="code" href="classOscl__TagTree.html">Oscl_TagTree<MM_StatsNodeTagTreeType, TagTree_Allocator></a> <a class="code" href="classOscl__TagTree.html">OsclTagTreeType</a>; 38900391 39000392 391<a name="l00393"></a><a class="code" href="group__osclmemory.html#a65">00393</a> <span class="preprocessor">#define MM_AUDIT_VALIDATE_BLOCK 1</span> 392<a name="l00394"></a><a class="code" href="group__osclmemory.html#a66">00394</a> <span class="preprocessor"></span><span class="preprocessor">#define MM_AUDIT_PREFILL_FLAG 0x1</span> 393<a name="l00395"></a><a class="code" href="group__osclmemory.html#a67">00395</a> <span class="preprocessor"></span><span class="preprocessor">#define MM_AUDIT_POSTFILL_FLAG 0x2</span> 394<a name="l00396"></a><a class="code" href="group__osclmemory.html#a68">00396</a> <span class="preprocessor"></span><span class="preprocessor">#define MM_AUDIT_VALIDATE_ALL_HEAP_FLAG 0x4</span> 395<a name="l00397"></a><a class="code" href="group__osclmemory.html#a69">00397</a> <span class="preprocessor"></span><span class="preprocessor">#define MM_AUDIT_VALIDATE_ON_FREE_FLAG 0x8</span> 396<a name="l00398"></a><a class="code" href="group__osclmemory.html#a70">00398</a> <span class="preprocessor"></span><span class="preprocessor">#define MM_AUDIT_ALLOC_NODE_ENABLE_FLAG 0x10</span> 397<a name="l00399"></a><a class="code" href="group__osclmemory.html#a71">00399</a> <span class="preprocessor"></span><span class="preprocessor">#define MM_AUDIT_SUPPRESS_FILENAME_FLAG 0x20</span> 39800400 <span class="preprocessor"></span> 39900401 <span class="preprocessor">#if(PVMEM_INST_LEVEL>0)</span> 40000402 <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_MM_AUDIT_MODE (MM_AUDIT_PREFILL_FLAG | \</span> 40100403 <span class="preprocessor"> MM_AUDIT_POSTFILL_FLAG | \</span> 40200404 <span class="preprocessor"> MM_AUDIT_VALIDATE_ON_FREE_FLAG | \</span> 40300405 <span class="preprocessor"> MM_AUDIT_ALLOC_NODE_ENABLE_FLAG )</span> 40400406 <span class="preprocessor"></span> 40500407 40600408 40700409 <span class="preprocessor">#else</span> 408<a name="l00410"></a><a class="code" href="group__osclmemory.html#a72">00410</a> <span class="preprocessor"></span><span class="preprocessor">#define DEFAULT_MM_AUDIT_MODE 0</span> 40900411 <span class="preprocessor"></span><span class="preprocessor">#endif</span> 41000412 <span class="preprocessor"></span> 41100413 412<a name="l00414"></a><a class="code" href="structMM__AuditOverheadStats.html">00414</a> <span class="keyword">struct </span><a class="code" href="structMM__AuditOverheadStats.html">MM_AuditOverheadStats</a> 41300415 { 414<a name="l00416"></a><a class="code" href="structMM__AuditOverheadStats.html#m0">00416</a> uint32 <a class="code" href="structMM__AuditOverheadStats.html#m0">per_allocation_overhead</a>; 415<a name="l00417"></a><a class="code" href="structMM__AuditOverheadStats.html#m1">00417</a> uint32 <a class="code" href="structMM__AuditOverheadStats.html#m1">stats_overhead</a>; 41600418 }; 41700419 41800420 <span class="preprocessor">#if OSCL_BYPASS_MEMMGT</span> 41900421 <span class="preprocessor"></span><span class="comment">//an empty class for compilation only</span> 42000422 <span class="keyword">class </span><a class="code" href="classMM__Audit__Imp.html">MM_Audit_Imp</a> 42100423 { 42200424 <span class="keyword">public</span>: 42300425 }; 42400426 <span class="preprocessor">#else</span> 425<a name="l00427"></a><a class="code" href="classMM__Audit__Imp.html">00427</a> <span class="preprocessor"></span><span class="keyword">class </span><a class="code" href="classMM__Audit__Imp.html">MM_Audit_Imp</a> 42600428 { 42700429 <span class="keyword">public</span>: 42800430 42900434 <a class="code" href="classMM__Audit__Imp.html#a0">MM_Audit_Imp</a>(); 43000435 43100439 <a class="code" href="classMM__Audit__Imp.html#a1">~MM_Audit_Imp</a>(); 43200440 43300447 OSCL_IMPORT_REF <span class="keywordtype">void</span> *<a class="code" href="classMM__Audit__Imp.html#a2">MM_allocate</a>(<span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* statsNode, 43400448 uint32 sizeIn, 43500449 <span class="keyword">const</span> <span class="keywordtype">char</span> *pFileName, 43600450 uint32 lineNumber, 43700451 <span class="keywordtype">bool</span> allocNodeTracking = <span class="keyword">false</span>); 43800452 43900456 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a3">MM_deallocate</a>(<span class="keywordtype">void</span> *pMemBlockIn); 44000457 44100462 OSCL_IMPORT_REF <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a> * <a class="code" href="classMM__Audit__Imp.html#a4">MM_GetStats</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> tagIn); 44200463 44300468 OSCL_IMPORT_REF uint32 <a class="code" href="classMM__Audit__Imp.html#a5">MM_GetStatsInDepth</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn, <a class="code" href="structMM__Stats__CB.html">MM_Stats_CB</a> *array_ptr, uint32 max_nodes); 44400469 44500475 OSCL_IMPORT_REF uint32 <a class="code" href="classMM__Audit__Imp.html#a6">MM_GetTreeNodes</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn); 44600476 447<a name="l00482"></a><a class="code" href="classMM__Audit__Imp.html#a7">00482</a> OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a7">MM_AddTag</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 44800483 { 44900484 <span class="keywordflow">return</span> (<a class="code" href="classMM__Audit__Imp.html#a8">MM_GetTagNode</a>(tagIn) != <a class="code" href="group__osclbase.html#a81">NULL</a>); 45000485 }; 45100486 45200493 OSCL_IMPORT_REF <span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* <a class="code" href="classMM__Audit__Imp.html#a8">MM_GetTagNode</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn); 45300494 45400495 45500502 OSCL_IMPORT_REF <span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* <a class="code" href="classMM__Audit__Imp.html#a9">MM_GetExistingTag</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn); 45600503 45700504 458<a name="l00505"></a><a class="code" href="classMM__Audit__Imp.html#a10">00505</a> OSCL_IMPORT_REF <span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* <a class="code" href="classMM__Audit__Imp.html#a10">MM_GetRootNode</a>() 45900506 { 46000507 <span class="keywordflow">return</span> mpStatsNode; 46100508 }; 46200509 46300514 OSCL_IMPORT_REF <a class="code" href="structMM__AllocQueryInfo.html">MM_AllocQueryInfo</a>* <a class="code" href="classMM__Audit__Imp.html#a11">MM_CreateAllocNodeInfo</a>(uint32 max_array_size); 46400515 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a12">MM_ReleaseAllocNodeInfo</a>(<a class="code" href="structMM__AllocQueryInfo.html">MM_AllocQueryInfo</a>* info); 46500516 46600526 OSCL_IMPORT_REF uint32 <a class="code" href="classMM__Audit__Imp.html#a13">MM_GetAllocNodeInfo</a>(<a class="code" href="structMM__AllocQueryInfo.html">MM_AllocQueryInfo</a>* output_array, 46700527 uint32 max_array_size, uint32 offset); 46800528 46900534 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a14">MM_Validate</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *ptrIn); 47000535 471<a name="l00540"></a><a class="code" href="classMM__Audit__Imp.html#a15">00540</a> uint32 <a class="code" href="classMM__Audit__Imp.html#a15">MM_GetAllocNo</a>(<span class="keywordtype">void</span>) 47200541 { 47300542 <span class="keywordflow">return</span> mnAllocNum; 47400543 } 47500544 476<a name="l00549"></a><a class="code" href="classMM__Audit__Imp.html#a16">00549</a> <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a16">MM_GetOverheadStats</a>(<a class="code" href="structMM__AuditOverheadStats.html">MM_AuditOverheadStats</a>& stats) 47700550 { 47800551 stats.<a class="code" href="structMM__AuditOverheadStats.html#m0">per_allocation_overhead</a> = mm_audit_per_block_overhead; 47900552 stats.<a class="code" href="structMM__AuditOverheadStats.html#m1">stats_overhead</a> = mm_audit_stats_overhead; 48000553 } 48100554 482<a name="l00559"></a><a class="code" href="classMM__Audit__Imp.html#a17">00559</a> uint32 <a class="code" href="classMM__Audit__Imp.html#a17">MM_GetNumAllocNodes</a>() 48300560 { 48400561 <span class="keywordflow">return</span> mNumAllocNodes; 48500562 }; 48600563 487<a name="l00567"></a><a class="code" href="classMM__Audit__Imp.html#a18">00567</a> uint32 <a class="code" href="classMM__Audit__Imp.html#a18">MM_GetMode</a>(<span class="keywordtype">void</span>) 48800568 { 48900569 <span class="keywordflow">return</span> mode; 49000570 } 49100571 492<a name="l00576"></a><a class="code" href="classMM__Audit__Imp.html#a19">00576</a> uint8 <a class="code" href="classMM__Audit__Imp.html#a19">MM_GetPrefillPattern</a>(<span class="keywordtype">void</span>) 49300577 { 49400578 <span class="keywordflow">return</span> prefill_pattern; 49500579 } 49600580 497<a name="l00585"></a><a class="code" href="classMM__Audit__Imp.html#a20">00585</a> uint32 <a class="code" href="classMM__Audit__Imp.html#a20">MM_GetPostfillPattern</a>(<span class="keywordtype">void</span>) 49800586 { 49900587 <span class="keywordflow">return</span> postfill_pattern; 50000588 } 50100589 50200593 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a21">MM_SetMode</a>(uint32 inMode); 50300594 50400598 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a22">MM_SetPrefillPattern</a>(uint8 pattern); 50500599 50600603 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a23">MM_SetPostfillPattern</a>(uint8 pattern); 50700604 50800609 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a24">MM_SetTagLevel</a>(uint32 level); 50900610 51000617 OSCL_IMPORT_REF <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a25">MM_SetFailurePoint</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn, uint32 alloc_number); 51100618 51200623 OSCL_IMPORT_REF <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a26">MM_UnsetFailurePoint</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn); 51300624 51400625 51500626 <span class="comment">/*</span> 51600627 <span class="comment"> * The following are private member functions</span> 51700628 <span class="comment"> */</span> 51800629 51900630 52000634 <a class="code" href="structMM__AllocNode.html">MM_AllocNode</a>* <a class="code" href="classMM__Audit__Imp.html#a27">addAllocNode</a>(<span class="keywordtype">void</span> *pMem, uint32 sizeIn, <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* pStatsNode, <span class="keyword">const</span> <span class="keywordtype">char</span> *pFileName, uint32 lineNumber); 52100638 <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* <a class="code" href="classMM__Audit__Imp.html#a28">removeAllocNode</a>(<span class="keywordtype">void</span> *pMemBlockIn, uint32& size); 52200639 <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a29">removeALLAllocNodes</a>(); 52300640 52400644 <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* <a class="code" href="classMM__Audit__Imp.html#a30">createStatsNode</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn); 52500648 <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a31">updateStatsNode</a>(<a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> *pCurrStatsNode, 52600649 <span class="keyword">const</span> <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a>& pDelta, <span class="keywordtype">bool</span> bAdd); 52700653 <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a32">updateStatsNodeInFailure</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn); 52800654 <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a32">updateStatsNodeInFailure</a>(<a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> * pStatsNode); 52900658 <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a34">pruneSubtree</a>(<a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> *pNode); 53000659 <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a34">pruneSubtree</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn); 53100660 53200661 <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a36">retrieveParentTag</a>(<span class="keywordtype">char</span> *tag); 53300665 int32 <a class="code" href="classMM__Audit__Imp.html#a37">retrieveParentTagLength</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *tag, int32 bound); 53400669 <span class="keywordtype">void</span> <a class="code" href="classMM__Audit__Imp.html#a38">makeValidTag</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn, MMAuditCharAutoPtr& autoptr); 53500673 uint32 <a class="code" href="classMM__Audit__Imp.html#a39">getTagActualSize</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn); 53600680 <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a40">isSetFailure</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn); 53700681 53800682 <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a40">isSetFailure</a>(<a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> * statsNode); 53900686 <span class="keyword">static</span> <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#d0">validate</a>(<span class="keywordtype">void</span> *ptrIn); 54000687 54100691 <span class="keyword">static</span> <a class="code" href="classOsclMemAudit.html">OsclMemAudit</a>* <a class="code" href="classMM__Audit__Imp.html#d1">getAuditRoot</a>(<span class="keywordtype">void</span> *ptrIn); 54200692 54300696 <span class="keyword">static</span> uint32 <a class="code" href="classMM__Audit__Imp.html#d2">getSize</a>(<span class="keywordtype">void</span> *ptrIn); 54400697 54500701 <span class="keywordtype">bool</span> <a class="code" href="classMM__Audit__Imp.html#a42">validate_all_heap</a>(); 54600702 54700703 <span class="keyword">private</span>: 54800704 54900705 <span class="keywordtype">void</span> populateChildren(<span class="keyword">const</span> <span class="keywordtype">char</span> *tagIn, 55000706 <a class="code" href="structMM__Stats__CB.html">MM_Stats_CB</a> *array_ptr, 55100707 uint32 &curr_array_index, 55200708 uint32 max_nodes); 55300709 55400710 <span class="comment">/*</span> 55500711 <span class="comment"> * The following are private data members</span> 55600712 <span class="comment"> */</span> 55700713 55800718 <a class="code" href="structMM__AllocNode.html">MM_AllocNode</a> *mpAllocNode, *mpCurrAllocNode; 55900719 56000724 uint32 mNumAllocNodes; 56100725 56200729 <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> *mpStatsNode; 56300734 OsclTagTreeType mTagTree; 56400738 uint32 mnAllocNum; 56500739 uint32 mnMaxTagLevel; 56600740 uint32 mode; 56700741 56800742 uint32 mm_audit_per_block_overhead; 56900743 uint32 mm_audit_stats_overhead; 57000744 57100745 uint8 prefill_pattern; 57200746 uint8 postfill_pattern; 57300747 57400748 }; 57500749 <span class="preprocessor">#endif</span> 57600750 <span class="preprocessor"></span> 57700751 <span class="preprocessor">#if OSCL_BYPASS_MEMMGT</span> 57800752 <span class="preprocessor"></span><span class="comment">//an empty class for compilation only.</span> 57900753 <span class="keyword">class </span><a class="code" href="classOsclMemAudit.html">OsclMemAudit</a> 58000754 { 58100755 <span class="keyword">public</span>: 58200756 }; 58300757 <span class="preprocessor">#else</span> 584<a name="l00758"></a><a class="code" href="classOsclMemAudit.html">00758</a> <span class="preprocessor"></span><span class="keyword">class </span><a class="code" href="classOsclMemAudit.html">OsclMemAudit</a> 58500759 { 58600760 <span class="keyword">public</span>: 587<a name="l00764"></a><a class="code" href="classOsclMemAudit.html#a0">00764</a> <a class="code" href="classOsclMemAudit.html#a0">OsclMemAudit</a>() 58800765 { 58900766 <span class="keywordtype">void</span> * p = <a class="code" href="group__osclmemory.html#a7">_oscl_malloc</a>(<span class="keyword">sizeof</span>(<a class="code" href="classMM__Audit__Imp.html">MM_Audit_Imp</a>)); 59000767 <a class="code" href="classOsclError.html#d8">OsclError::LeaveIfNull</a>(p); 59100768 59200769 <span class="comment">// this will invoke system placement new operator</span> 59300770 _pMM_Audit_Imp = <a class="code" href="group__osclmemory.html#a53">OSCL_PLACEMENT_NEW</a>(p, <a class="code" href="classMM__Audit__Imp.html">MM_Audit_Imp</a>()); 59400771 iLock = &iSingletonLock; 59500772 iRefCount = 1; 59600773 }; 59700774 598<a name="l00778"></a><a class="code" href="classOsclMemAudit.html#a1">00778</a> <a class="code" href="classOsclMemAudit.html#a1">~OsclMemAudit</a>() 59900779 { 60000780 _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a1">~MM_Audit_Imp</a>(); 60100781 <a class="code" href="group__osclmemory.html#a10">_oscl_free</a>((<span class="keywordtype">void</span> *) _pMM_Audit_Imp); 60200782 }; 60300783 604<a name="l00790"></a><a class="code" href="classOsclMemAudit.html#a2">00790</a> <span class="keywordtype">void</span> *<a class="code" href="classOsclMemAudit.html#a2">MM_allocate</a>(<span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* statsNode, 60500791 uint32 sizeIn, 60600792 <span class="keyword">const</span> <span class="keywordtype">char</span> *pFileName, 60700793 uint32 lineNumber, 60800794 <span class="keywordtype">bool</span> allocNodeTracking = <span class="keyword">false</span>) 60900795 { 61000796 <span class="comment">// make sure lock is acquired and freed up upon return</span> 61100797 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 61200798 61300799 <span class="keywordtype">void</span>* result = _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a2">MM_allocate</a>(statsNode, sizeIn, pFileName, lineNumber, allocNodeTracking); 61400800 61500801 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 61600802 <span class="keywordflow">return</span> result; 61700803 }; 61800804 619<a name="l00808"></a><a class="code" href="classOsclMemAudit.html#a3">00808</a> <span class="keywordtype">bool</span> <a class="code" href="classOsclMemAudit.html#a3">MM_deallocate</a>(<span class="keywordtype">void</span> *pMemBlockIn) 62000809 { 62100810 <span class="comment">// make sure lock is acquired and freed up upon return</span> 62200811 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 62300812 62400813 <span class="keywordtype">bool</span> result = _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a3">MM_deallocate</a>(pMemBlockIn); 62500814 62600815 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 62700816 <span class="keywordflow">return</span> result; 62800817 }; 62900818 630<a name="l00823"></a><a class="code" href="classOsclMemAudit.html#a4">00823</a> <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a> * <a class="code" href="classOsclMemAudit.html#a4">MM_GetStats</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * <span class="keyword">const</span> tagIn) 63100824 { 63200825 <span class="comment">// make sure lock is acquired and freed up upon return</span> 63300826 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 63400827 63500828 <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a>* result = (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a4">MM_GetStats</a>(tagIn)); 63600829 63700830 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 63800831 <span class="keywordflow">return</span> result; 63900832 }; 64000833 641<a name="l00838"></a><a class="code" href="classOsclMemAudit.html#a5">00838</a> uint32 <a class="code" href="classOsclMemAudit.html#a5">MM_GetStatsInDepth</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn, <a class="code" href="structMM__Stats__CB.html">MM_Stats_CB</a> *array_ptr, uint32 max_nodes) 64200839 { 64300840 <span class="comment">// make sure lock is acquired and freed up upon return</span> 64400841 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 64500842 64600843 uint32 result = (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a5">MM_GetStatsInDepth</a>(tagIn, array_ptr, max_nodes)); 64700844 64800845 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 64900846 <span class="keywordflow">return</span> result; 65000847 }; 65100848 652<a name="l00854"></a><a class="code" href="classOsclMemAudit.html#a6">00854</a> uint32 <a class="code" href="classOsclMemAudit.html#a6">MM_GetTreeNodes</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 65300855 { 65400856 <span class="comment">// make sure lock is acquired and freed up upon return</span> 65500857 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 65600858 65700859 uint32 result = (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a6">MM_GetTreeNodes</a>(tagIn)); 65800860 65900861 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 66000862 <span class="keywordflow">return</span> result; 66100863 }; 66200864 663<a name="l00870"></a><a class="code" href="classOsclMemAudit.html#a7">00870</a> <span class="keywordtype">bool</span> <a class="code" href="classOsclMemAudit.html#a7">MM_AddTag</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 66400871 { 66500872 <span class="keywordflow">return</span> (<a class="code" href="classOsclMemAudit.html#a8">MM_GetTagNode</a>(tagIn) != <a class="code" href="group__osclbase.html#a81">NULL</a>); 66600873 }; 66700874 668<a name="l00881"></a><a class="code" href="classOsclMemAudit.html#a8">00881</a> <span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* <a class="code" href="classOsclMemAudit.html#a8">MM_GetTagNode</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 66900882 { 67000883 <span class="comment">// make sure lock is acquired and freed up upon return</span> 67100884 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 67200885 67300886 <span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* result = (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a8">MM_GetTagNode</a>(tagIn)); 67400887 67500888 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 67600889 <span class="keywordflow">return</span> result; 67700890 }; 67800891 67900892 680<a name="l00899"></a><a class="code" href="classOsclMemAudit.html#a9">00899</a> <span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* <a class="code" href="classOsclMemAudit.html#a9">MM_GetExistingTag</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 68100900 { 68200901 <span class="comment">// make sure lock is acquired and freed up upon return</span> 68300902 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 68400903 68500904 <span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* result = (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a9">MM_GetExistingTag</a>(tagIn)); 68600905 68700906 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 68800907 <span class="keywordflow">return</span> result; 68900908 }; 69000909 69100910 692<a name="l00911"></a><a class="code" href="classOsclMemAudit.html#a10">00911</a> <span class="keyword">const</span> <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* <a class="code" href="classOsclMemAudit.html#a10">MM_GetRootNode</a>() 69300912 { 69400913 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a10">MM_GetRootNode</a>()); 69500914 }; 69600915 697<a name="l00925"></a><a class="code" href="classOsclMemAudit.html#a11">00925</a> uint32 <a class="code" href="classOsclMemAudit.html#a11">MM_GetAllocNodeInfo</a>(<a class="code" href="structMM__AllocQueryInfo.html">MM_AllocQueryInfo</a>* output_array, 69800926 uint32 max_array_size, uint32 offset) 69900927 { 70000928 <span class="comment">// make sure lock is acquired and freed up upon return</span> 70100929 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 70200930 70300931 uint32 result = (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a13">MM_GetAllocNodeInfo</a>(output_array, max_array_size, offset)); 70400932 70500933 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 70600934 <span class="keywordflow">return</span> result; 70700935 }; 70800936 709<a name="l00937"></a><a class="code" href="classOsclMemAudit.html#a12">00937</a> <a class="code" href="structMM__AllocQueryInfo.html">MM_AllocQueryInfo</a>* <a class="code" href="classOsclMemAudit.html#a12">MM_CreateAllocNodeInfo</a>(uint32 max_array_size) 71000938 { 71100939 <span class="keywordflow">return</span> _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a11">MM_CreateAllocNodeInfo</a>(max_array_size); 71200940 } 713<a name="l00941"></a><a class="code" href="classOsclMemAudit.html#a13">00941</a> <span class="keywordtype">void</span> <a class="code" href="classOsclMemAudit.html#a13">MM_ReleaseAllocNodeInfo</a>(<a class="code" href="structMM__AllocQueryInfo.html">MM_AllocQueryInfo</a>* info) 71400942 { 71500943 _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a12">MM_ReleaseAllocNodeInfo</a>(info); 71600944 } 71700945 718<a name="l00951"></a><a class="code" href="classOsclMemAudit.html#a14">00951</a> <span class="keywordtype">bool</span> <a class="code" href="classOsclMemAudit.html#a14">MM_Validate</a>(<span class="keyword">const</span> <span class="keywordtype">void</span> *ptrIn) 71900952 { 72000953 <span class="comment">// make sure lock is acquired and freed up upon return</span> 72100954 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 72200955 72300956 <span class="keywordtype">bool</span> result = (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a14">MM_Validate</a>(ptrIn)); 72400957 72500958 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 72600959 <span class="keywordflow">return</span> result; 72700960 }; 72800961 729<a name="l00966"></a><a class="code" href="classOsclMemAudit.html#a15">00966</a> uint32 <a class="code" href="classOsclMemAudit.html#a15">MM_GetAllocNo</a>(<span class="keywordtype">void</span>) 73000967 { 73100968 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a15">MM_GetAllocNo</a>()); 73200969 }; 73300970 734<a name="l00975"></a><a class="code" href="classOsclMemAudit.html#a16">00975</a> <span class="keywordtype">void</span> <a class="code" href="classOsclMemAudit.html#a16">MM_GetOverheadStats</a>(<a class="code" href="structMM__AuditOverheadStats.html">MM_AuditOverheadStats</a>& stats) 73500976 { 73600977 _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a16">MM_GetOverheadStats</a>(stats); 73700978 }; 73800979 739<a name="l00984"></a><a class="code" href="classOsclMemAudit.html#a17">00984</a> uint32 <a class="code" href="classOsclMemAudit.html#a17">MM_GetNumAllocNodes</a>() 74000985 { 74100986 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a17">MM_GetNumAllocNodes</a>()); 74200987 }; 74300988 744<a name="l00992"></a><a class="code" href="classOsclMemAudit.html#a18">00992</a> uint32 <a class="code" href="classOsclMemAudit.html#a18">MM_GetMode</a>(<span class="keywordtype">void</span>) 74500993 { 74600994 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a18">MM_GetMode</a>()); 74700995 }; 74800996 749<a name="l01001"></a><a class="code" href="classOsclMemAudit.html#a19">01001</a> uint8 <a class="code" href="classOsclMemAudit.html#a19">MM_GetPrefillPattern</a>(<span class="keywordtype">void</span>) 75001002 { 75101003 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a19">MM_GetPrefillPattern</a>()); 75201004 }; 75301005 754<a name="l01010"></a><a class="code" href="classOsclMemAudit.html#a20">01010</a> uint32 <a class="code" href="classOsclMemAudit.html#a20">MM_GetPostfillPattern</a>(<span class="keywordtype">void</span>) 75501011 { 75601012 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a20">MM_GetPostfillPattern</a>()); 75701013 }; 75801014 759<a name="l01018"></a><a class="code" href="classOsclMemAudit.html#a21">01018</a> <span class="keywordtype">void</span> <a class="code" href="classOsclMemAudit.html#a21">MM_SetMode</a>(uint32 inMode) 76001019 { 76101020 <span class="comment">// make sure lock is acquired and freed up upon return</span> 76201021 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 76301022 76401023 _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a21">MM_SetMode</a>(inMode); 76501024 76601025 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 76701026 }; 76801027 769<a name="l01031"></a><a class="code" href="classOsclMemAudit.html#a22">01031</a> <span class="keywordtype">void</span> <a class="code" href="classOsclMemAudit.html#a22">MM_SetPrefillPattern</a>(uint8 pattern) 77001032 { 77101033 <span class="comment">// make sure lock is acquired and freed up upon return</span> 77201034 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 77301035 77401036 _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a22">MM_SetPrefillPattern</a>(pattern); 77501037 77601038 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 77701039 }; 77801040 779<a name="l01044"></a><a class="code" href="classOsclMemAudit.html#a23">01044</a> <span class="keywordtype">void</span> <a class="code" href="classOsclMemAudit.html#a23">MM_SetPostfillPattern</a>(uint8 pattern) 78001045 { 78101046 <span class="comment">// make sure lock is acquired and freed up upon return</span> 78201047 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 78301048 78401049 _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a23">MM_SetPostfillPattern</a>(pattern); 78501050 78601051 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 78701052 }; 78801053 789<a name="l01058"></a><a class="code" href="classOsclMemAudit.html#a24">01058</a> <span class="keywordtype">void</span> <a class="code" href="classOsclMemAudit.html#a24">MM_SetTagLevel</a>(uint32 level) 79001059 { 79101060 <span class="comment">// make sure lock is acquired and freed up upon return</span> 79201061 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 79301062 79401063 _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a24">MM_SetTagLevel</a>(level); 79501064 79601065 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 79701066 }; 79801067 799<a name="l01074"></a><a class="code" href="classOsclMemAudit.html#a25">01074</a> <span class="keywordtype">bool</span> <a class="code" href="classOsclMemAudit.html#a25">MM_SetFailurePoint</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn, uint32 alloc_number) 80001075 { 80101076 <span class="comment">// make sure lock is acquired and freed up upon return</span> 80201077 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 80301078 80401079 <span class="keywordtype">bool</span> result = (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a25">MM_SetFailurePoint</a>(tagIn, alloc_number)); 80501080 80601081 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 80701082 <span class="keywordflow">return</span> result; 80801083 }; 80901084 81001085 811<a name="l01090"></a><a class="code" href="classOsclMemAudit.html#a26">01090</a> <span class="keywordtype">void</span> <a class="code" href="classOsclMemAudit.html#a26">MM_UnsetFailurePoint</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 81201091 { 81301092 <span class="comment">// make sure lock is acquired and freed up upon return</span> 81401093 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 81501094 81601095 _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a26">MM_UnsetFailurePoint</a>(tagIn); 81701096 81801097 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 81901098 }; 82001099 821<a name="l01100"></a><a class="code" href="classOsclMemAudit.html#a27">01100</a> int32 <a class="code" href="classOsclMemAudit.html#a27">MM_GetRefCount</a>() 82201101 { 82301102 int32 count; 82401103 iLock-><a class="code" href="classOsclLockBase.html#a0">Lock</a>(); 82501104 count = iRefCount; 82601105 iLock-><a class="code" href="classOsclLockBase.html#a1">Unlock</a>(); 82701106 <span class="keywordflow">return</span> count; 82801107 } 82901108 830<a name="l01114"></a><a class="code" href="classOsclMemAudit.html#a28">01114</a> <a class="code" href="classOsclLockBase.html">OsclLockBase</a>* <a class="code" href="classOsclMemAudit.html#a28">GetLock</a>() 83101115 { 83201116 <span class="keywordflow">return</span> iLock; 83301117 }; 83401118 83501119 <span class="comment">/*</span> 83601120 <span class="comment"> * The following are private member functions</span> 83701121 <span class="comment"> */</span> 83801122 83901123 <span class="keyword">private</span>: 84001127 <a class="code" href="structMM__AllocNode.html">MM_AllocNode</a>* addAllocNode(<span class="keywordtype">void</span> *pMem, uint32 sizeIn, <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* pStatsNode, 84101128 <span class="keyword">const</span> <span class="keywordtype">char</span> *pFileName, uint32 lineNumber) 84201129 { 84301130 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a27">addAllocNode</a>(pMem, sizeIn, pStatsNode, pFileName, lineNumber)); 84401131 } 84501132 84601136 <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* removeAllocNode(<span class="keywordtype">void</span> *pMemBlockIn, uint32& size) 84701137 { 84801138 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a28">removeAllocNode</a>(pMemBlockIn, size)); 84901139 } 85001140 85101141 <span class="keywordtype">void</span> removeALLAllocNodes() 85201142 { 85301143 _pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a29">removeALLAllocNodes</a>(); 85401144 } 85501145 85601149 <a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a>* createStatsNode(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 85701150 { 85801151 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a30">createStatsNode</a>(tagIn)); 85901152 } 86001153 86101157 <span class="keywordtype">bool</span> updateStatsNode(<a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> *pCurrStatsNode, 86201158 <span class="keyword">const</span> <a class="code" href="structMM__Stats__t.html">MM_Stats_t</a>& pDelta, <span class="keywordtype">bool</span> bAdd) 86301159 { 86401160 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a31">updateStatsNode</a>(pCurrStatsNode, pDelta, bAdd)); 86501161 } 86601162 86701166 <span class="keywordtype">bool</span> updateStatsNodeInFailure(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 86801167 { 86901168 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a32">updateStatsNodeInFailure</a>(tagIn)); 87001169 } 87101170 87201171 <span class="keywordtype">bool</span> updateStatsNodeInFailure(<a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> * pStatsNode) 87301172 { 87401173 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a32">updateStatsNodeInFailure</a>(pStatsNode)); 87501174 } 87601175 87701179 <span class="keywordtype">bool</span> pruneSubtree(<a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> *pNode) 87801180 { 87901181 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a34">pruneSubtree</a>(pNode)); 88001182 } 88101183 88201184 <span class="keywordtype">bool</span> pruneSubtree(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 88301185 { 88401186 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a34">pruneSubtree</a>(tagIn)); 88501187 } 88601188 88701189 <span class="keywordtype">void</span> retrieveParentTag(<span class="keywordtype">char</span> *tag) 88801190 { 88901191 (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a36">retrieveParentTag</a>(tag)); 89001192 } 89101193 89201197 int32 retrieveParentTagLength(<span class="keyword">const</span> <span class="keywordtype">char</span> *tag, int32 bound) 89301198 { 89401199 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a37">retrieveParentTagLength</a>(tag, bound)); 89501200 } 89601201 89701205 <span class="keywordtype">void</span> makeValidTag(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn, MMAuditCharAutoPtr& autoptr) 89801206 { 89901207 (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a38">makeValidTag</a>(tagIn, autoptr)); 90001208 } 90101209 90201213 uint32 getTagActualSize(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 90301214 { 90401215 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a39">getTagActualSize</a>(tagIn)); 90501216 } 90601217 90701221 <span class="keywordtype">bool</span> isSetFailure(<span class="keyword">const</span> <span class="keywordtype">char</span> * tagIn) 90801222 { 90901223 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a40">isSetFailure</a>(tagIn)); 91001224 } 91101225 91201226 <span class="keywordtype">bool</span> isSetFailure(<a class="code" href="classOsclMemStatsNode.html">OsclMemStatsNode</a> * statsNode) 91301227 { 91401228 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a40">isSetFailure</a>(statsNode)); 91501229 } 91601230 91701234 <span class="keywordtype">bool</span> validate(<span class="keywordtype">void</span> *ptrIn) 91801235 { 91901236 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#d0">validate</a>(ptrIn)); 92001237 } 92101238 92201242 <span class="keywordtype">bool</span> validate_all_heap() 92301243 { 92401244 <span class="keywordflow">return</span> (_pMM_Audit_Imp-><a class="code" href="classMM__Audit__Imp.html#a42">validate_all_heap</a>()); 92501245 } 92601246 92701247 92801248 <span class="keyword">private</span>: 92901249 93001250 <span class="comment">/*</span> 93101251 <span class="comment"> * The following are private data members</span> 93201252 <span class="comment"> */</span> 93301253 93401254 <a class="code" href="classMM__Audit__Imp.html">MM_Audit_Imp</a> *_pMM_Audit_Imp; 93501255 <a class="code" href="classOsclLockBase.html">OsclLockBase</a> *iLock; 93601256 93701260 _OsclBasicLock iSingletonLock; 93801261 int32 iRefCount; 939<a name="l01262"></a><a class="code" href="classOsclMemAudit.html#l0">01262</a> <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classOsclMemGlobalAuditObject.html">OsclMemGlobalAuditObject</a>; 94001263 94101264 }; 94201265 <span class="preprocessor">#endif</span> 94301266 <span class="preprocessor"></span> 94401267 <span class="preprocessor">#endif //OSCL_MEM_AUDIT_H_INCLUDED</span> 94501268 <span class="preprocessor"></span> 946</pre></div><hr size="1"><img src="pvlogo_small.jpg"><address style="align: right;"><small>OSCL API</small> 947<address style="align: left;"><small>Posting Version: OPENCORE_20090310 </small> 948</small></address> 949</body> 950</html> 951