\doxysection{Vmem class}
\label{a00053}\index{Vmem class@{Vmem class}}


This class provides a safe logged version of malloc and free.  


\doxysubsubsection*{Files}
\begin{DoxyCompactItemize}
\item 
file \textbf{ vmem.\+h}
\begin{DoxyCompactList}\small\item\em Class Vmem\+: A safer, object-\/oriented, malloc/free object. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Classes}
\begin{DoxyCompactItemize}
\item 
struct \textbf{ s\+Vmem}
\begin{DoxyCompactList}\small\item\em Contains public data members for Vmem class. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct \textbf{ s\+Vmem} \textbf{ Vmem}
\begin{DoxyCompactList}\small\item\em Declaration of the Vmem class as the Vmem structure. \end{DoxyCompactList}\end{DoxyCompactItemize}
\doxysubsubsection*{Functions}
\begin{DoxyCompactItemize}
\item 
size\+\_\+t \textbf{ Vmem\+\_\+bytes\+Total} (void)
\begin{DoxyCompactList}\small\item\em Return total of all active Vmem malloc areas (current footprint) \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Vmem\+\_\+malloc\+Bytes\+Total} (void)
\begin{DoxyCompactList}\small\item\em Return total of all Vmem malloc allocations. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Vmem\+\_\+free\+Bytes\+Total} (void)
\begin{DoxyCompactList}\small\item\em Return total of all Vmem free calls. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Vmem\+\_\+high\+Water\+Total} (void)
\begin{DoxyCompactList}\small\item\em Return the high-\/water byte mark (largest footprint) \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Vmem\+\_\+malloc\+Areas\+Total} (void)
\begin{DoxyCompactList}\small\item\em Return total of all active Vmem malloc areas by groups. \end{DoxyCompactList}\item 
void \textbf{ Vmem\+\_\+print\+Total} (void)
\begin{DoxyCompactList}\small\item\em Print current memory statistics for all Vmem malloc/free areas. \end{DoxyCompactList}\item 
\textbf{ Vmem} $\ast$ \textbf{ Vmem\+\_\+ctor} (char $\ast$name)
\begin{DoxyCompactList}\small\item\em Construct the dynamic memory allocation logging object. \end{DoxyCompactList}\item 
void \textbf{ Vmem\+\_\+dtor} (\textbf{ Vmem} $\ast$$\ast$thee)
\begin{DoxyCompactList}\small\item\em Destruct the dynamic memory allocation logging object. \end{DoxyCompactList}\item 
void $\ast$ \textbf{ Vmem\+\_\+malloc} (\textbf{ Vmem} $\ast$thee, size\+\_\+t num, size\+\_\+t size)
\begin{DoxyCompactList}\small\item\em A safe logged version of malloc. \end{DoxyCompactList}\item 
void \textbf{ Vmem\+\_\+free} (\textbf{ Vmem} $\ast$thee, size\+\_\+t num, size\+\_\+t size, void $\ast$$\ast$ram)
\begin{DoxyCompactList}\small\item\em A safe logged version of free. \end{DoxyCompactList}\item 
void $\ast$ \textbf{ Vmem\+\_\+realloc} (\textbf{ Vmem} $\ast$thee, size\+\_\+t num, size\+\_\+t size, void $\ast$$\ast$ram, size\+\_\+t new\+Num)
\begin{DoxyCompactList}\small\item\em A safe logged version of realloc (usually a bad idea to use this) \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Vmem\+\_\+bytes} (\textbf{ Vmem} $\ast$thee)
\begin{DoxyCompactList}\small\item\em Return total of all ACTIVE malloc areas used by Vmem object. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Vmem\+\_\+malloc\+Bytes} (\textbf{ Vmem} $\ast$thee)
\begin{DoxyCompactList}\small\item\em Return total of all mallocs performed by Vmem object. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Vmem\+\_\+free\+Bytes} (\textbf{ Vmem} $\ast$thee)
\begin{DoxyCompactList}\small\item\em Return total of all frees performed by Vmem object. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Vmem\+\_\+high\+Water} (\textbf{ Vmem} $\ast$thee)
\begin{DoxyCompactList}\small\item\em Return high-\/water malloc bytemark hit by Vmem object. \end{DoxyCompactList}\item 
size\+\_\+t \textbf{ Vmem\+\_\+malloc\+Areas} (\textbf{ Vmem} $\ast$thee)
\begin{DoxyCompactList}\small\item\em Return total number of individual active malloc areas. \end{DoxyCompactList}\item 
void \textbf{ Vmem\+\_\+print} (\textbf{ Vmem} $\ast$thee)
\begin{DoxyCompactList}\small\item\em Print current memory stats associated with this Vmem object. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
This class provides a safe logged version of malloc and free. 

This class provides a safe logged version of malloc and free, with all standard routines supported with Vmem variants. 

\doxysubsection{Typedef Documentation}
\index{Vmem class@{Vmem class}!Vmem@{Vmem}}
\index{Vmem@{Vmem}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem}
{\footnotesize\ttfamily \label{a00053_ga10a4d5e0b8931714c130ebb889adc715} 
typedef struct \textbf{ s\+Vmem} \textbf{ Vmem}}



Declaration of the Vmem class as the Vmem structure. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}


\doxysubsection{Function Documentation}
\index{Vmem class@{Vmem class}!Vmem\_bytes@{Vmem\_bytes}}
\index{Vmem\_bytes@{Vmem\_bytes}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_bytes()}
{\footnotesize\ttfamily \label{a00053_ga93a38736d54ecb245769c91307ae628b} 
size\+\_\+t Vmem\+\_\+bytes (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$}]{thee}{}\end{DoxyParamCaption})}



Return total of all ACTIVE malloc areas used by Vmem object. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
total of all ACTIVE malloc areas used by Vmem object 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_bytesTotal@{Vmem\_bytesTotal}}
\index{Vmem\_bytesTotal@{Vmem\_bytesTotal}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_bytesTotal()}
{\footnotesize\ttfamily \label{a00053_ga44ded885fceb61c63eff32282ff3613c} 
size\+\_\+t Vmem\+\_\+bytes\+Total (\begin{DoxyParamCaption}\item[{void}]{}{}\end{DoxyParamCaption})}



Return total of all active Vmem malloc areas (current footprint) 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
total of all active Vmem malloc areas (current footprint) 
\end{DoxyReturn}
\index{Vmem class@{Vmem class}!Vmem\_ctor@{Vmem\_ctor}}
\index{Vmem\_ctor@{Vmem\_ctor}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_ctor()}
{\footnotesize\ttfamily \label{a00053_ga75d736f0c5aabd31a9ed40e82a7eac1a} 
\textbf{ Vmem} $\ast$ Vmem\+\_\+ctor (\begin{DoxyParamCaption}\item[{char $\ast$}]{name}{}\end{DoxyParamCaption})}



Construct the dynamic memory allocation logging object. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
Pointer to a newly created Vmem object 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em name} & Pointer to the object name \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_dtor@{Vmem\_dtor}}
\index{Vmem\_dtor@{Vmem\_dtor}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_dtor()}
{\footnotesize\ttfamily \label{a00053_gabcacb07a3b303fcd6c1346d3eb73dc99} 
void Vmem\+\_\+dtor (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$$\ast$}]{thee}{}\end{DoxyParamCaption})}



Destruct the dynamic memory allocation logging object. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_free@{Vmem\_free}}
\index{Vmem\_free@{Vmem\_free}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_free()}
{\footnotesize\ttfamily \label{a00053_ga004bb397117fc5a8df173a72b4b44c8e} 
void Vmem\+\_\+free (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$}]{thee}{, }\item[{size\+\_\+t}]{num}{, }\item[{size\+\_\+t}]{size}{, }\item[{void $\ast$$\ast$}]{ram}{}\end{DoxyParamCaption})}



A safe logged version of free. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
{\em num} & number of the allocated address \\
\hline
{\em size} & size of one allocated address \\
\hline
{\em ram} & Pointer to pointer of the reallocated memory \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_freeBytes@{Vmem\_freeBytes}}
\index{Vmem\_freeBytes@{Vmem\_freeBytes}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_freeBytes()}
{\footnotesize\ttfamily \label{a00053_ga1c3448d45887c034bbb1e84f37547bc8} 
size\+\_\+t Vmem\+\_\+free\+Bytes (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$}]{thee}{}\end{DoxyParamCaption})}



Return total of all frees performed by Vmem object. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
total of all frees performed by Vmem object 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_freeBytesTotal@{Vmem\_freeBytesTotal}}
\index{Vmem\_freeBytesTotal@{Vmem\_freeBytesTotal}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_freeBytesTotal()}
{\footnotesize\ttfamily \label{a00053_ga4d727b4c55abdd7703daa3556cd3fa45} 
size\+\_\+t Vmem\+\_\+free\+Bytes\+Total (\begin{DoxyParamCaption}\item[{void}]{}{}\end{DoxyParamCaption})}



Return total of all Vmem free calls. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
total of all Vmem free calls 
\end{DoxyReturn}
\index{Vmem class@{Vmem class}!Vmem\_highWater@{Vmem\_highWater}}
\index{Vmem\_highWater@{Vmem\_highWater}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_highWater()}
{\footnotesize\ttfamily \label{a00053_ga3c61c6e2d77355f0d3a5c3bc025d948b} 
size\+\_\+t Vmem\+\_\+high\+Water (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$}]{thee}{}\end{DoxyParamCaption})}



Return high-\/water malloc bytemark hit by Vmem object. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
high-\/water malloc bytemark hit by Vmem object 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_highWaterTotal@{Vmem\_highWaterTotal}}
\index{Vmem\_highWaterTotal@{Vmem\_highWaterTotal}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_highWaterTotal()}
{\footnotesize\ttfamily \label{a00053_ga8b4fae23f1b03b2aa63fd85570e04664} 
size\+\_\+t Vmem\+\_\+high\+Water\+Total (\begin{DoxyParamCaption}\item[{void}]{}{}\end{DoxyParamCaption})}



Return the high-\/water byte mark (largest footprint) 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
the high-\/water byte mark (largest footprint) 
\end{DoxyReturn}
\index{Vmem class@{Vmem class}!Vmem\_malloc@{Vmem\_malloc}}
\index{Vmem\_malloc@{Vmem\_malloc}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_malloc()}
{\footnotesize\ttfamily \label{a00053_ga413cc6792a1605ca740c6236606b8e83} 
void $\ast$ Vmem\+\_\+malloc (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$}]{thee}{, }\item[{size\+\_\+t}]{num}{, }\item[{size\+\_\+t}]{size}{}\end{DoxyParamCaption})}



A safe logged version of malloc. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
Void pointer to a new malloc area 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
{\em num} & number of the allocated address \\
\hline
{\em size} & size of one allocated address \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_mallocAreas@{Vmem\_mallocAreas}}
\index{Vmem\_mallocAreas@{Vmem\_mallocAreas}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_mallocAreas()}
{\footnotesize\ttfamily \label{a00053_ga022188a4a85cec8bdfdd388a67531077} 
size\+\_\+t Vmem\+\_\+malloc\+Areas (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$}]{thee}{}\end{DoxyParamCaption})}



Return total number of individual active malloc areas. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
total number of individual active malloc areas 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_mallocAreasTotal@{Vmem\_mallocAreasTotal}}
\index{Vmem\_mallocAreasTotal@{Vmem\_mallocAreasTotal}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_mallocAreasTotal()}
{\footnotesize\ttfamily \label{a00053_ga0c97ea1eeffc74bc0384b855d7386d38} 
size\+\_\+t Vmem\+\_\+malloc\+Areas\+Total (\begin{DoxyParamCaption}\item[{void}]{}{}\end{DoxyParamCaption})}



Return total of all active Vmem malloc areas by groups. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
total of all active Vmem malloc areas by groups 
\end{DoxyReturn}
\index{Vmem class@{Vmem class}!Vmem\_mallocBytes@{Vmem\_mallocBytes}}
\index{Vmem\_mallocBytes@{Vmem\_mallocBytes}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_mallocBytes()}
{\footnotesize\ttfamily \label{a00053_gac1b7e996a5bac5079f6f4f8631de9ecc} 
size\+\_\+t Vmem\+\_\+malloc\+Bytes (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$}]{thee}{}\end{DoxyParamCaption})}



Return total of all mallocs performed by Vmem object. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
total of all mallocs performed by Vmem object 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_mallocBytesTotal@{Vmem\_mallocBytesTotal}}
\index{Vmem\_mallocBytesTotal@{Vmem\_mallocBytesTotal}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_mallocBytesTotal()}
{\footnotesize\ttfamily \label{a00053_gad315925d7d4d8383089ef1a095a46342} 
size\+\_\+t Vmem\+\_\+malloc\+Bytes\+Total (\begin{DoxyParamCaption}\item[{void}]{}{}\end{DoxyParamCaption})}



Return total of all Vmem malloc allocations. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
total of all Vmem malloc allocations 
\end{DoxyReturn}
\index{Vmem class@{Vmem class}!Vmem\_print@{Vmem\_print}}
\index{Vmem\_print@{Vmem\_print}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_print()}
{\footnotesize\ttfamily \label{a00053_gaa3f66ad34c4c68093ba6bec24ae6f325} 
void Vmem\+\_\+print (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$}]{thee}{}\end{DoxyParamCaption})}



Print current memory stats associated with this Vmem object. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
\end{DoxyParams}
\index{Vmem class@{Vmem class}!Vmem\_printTotal@{Vmem\_printTotal}}
\index{Vmem\_printTotal@{Vmem\_printTotal}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_printTotal()}
{\footnotesize\ttfamily \label{a00053_ga0f10d3a26a130bfb9091f4b814e36b56} 
void Vmem\+\_\+print\+Total (\begin{DoxyParamCaption}\item[{void}]{}{}\end{DoxyParamCaption})}



Print current memory statistics for all Vmem malloc/free areas. 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
None 
\end{DoxyReturn}
\index{Vmem class@{Vmem class}!Vmem\_realloc@{Vmem\_realloc}}
\index{Vmem\_realloc@{Vmem\_realloc}!Vmem class@{Vmem class}}
\doxysubsubsection{Vmem\_realloc()}
{\footnotesize\ttfamily \label{a00053_ga66ea6c3843eefe046c41fb0638b87353} 
void $\ast$ Vmem\+\_\+realloc (\begin{DoxyParamCaption}\item[{\textbf{ Vmem} $\ast$}]{thee}{, }\item[{size\+\_\+t}]{num}{, }\item[{size\+\_\+t}]{size}{, }\item[{void $\ast$$\ast$}]{ram}{, }\item[{size\+\_\+t}]{new\+Num}{}\end{DoxyParamCaption})}



A safe logged version of realloc (usually a bad idea to use this) 

\begin{DoxyAuthor}{Author}
Michael Holst 
\end{DoxyAuthor}
\begin{DoxyNote}{Note}
Class Vmem\+: Non-\/\+Inlineable methods (vmem.\+c) 
\end{DoxyNote}
\begin{DoxyReturn}{Returns}
Void pointer to a new malloc area 
\end{DoxyReturn}

\begin{DoxyParams}{Parameters}
{\em thee} & Pointer to the Vmem object \\
\hline
{\em num} & number of the allocated address \\
\hline
{\em size} & size of one allocated address \\
\hline
{\em ram} & Pointer to pointer of the reallocated memory \\
\hline
{\em new\+Num} & number of the reallocated address \\
\hline
\end{DoxyParams}
