\hypertarget{util_2malloc_8h}{\section{opal/util/malloc.h File Reference}
\label{util_2malloc_8h}\index{opal/util/malloc.\+h@{opal/util/malloc.\+h}}
}
{\ttfamily \#include \char`\"{}opal\+\_\+config.\+h\char`\"{}}\\*
{\ttfamily \#include $<$stdlib.\+h$>$}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{util_2malloc_8h_a766715a46b707e7a23e3f22c4fb4247f}{\#define {\bfseries O\+P\+A\+L\+\_\+\+M\+A\+L\+L\+O\+C\+\_\+\+D\+E\+B\+U\+G\+\_\+\+L\+E\+V\+E\+L}~2}\label{util_2malloc_8h_a766715a46b707e7a23e3f22c4fb4247f}

\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S void \hyperlink{util_2malloc_8h_a3a67acc226d876437d6523de5a1eefd2}{opal\+\_\+malloc\+\_\+init} (void)
\begin{DoxyCompactList}\small\item\em Initialize malloc debug output. \end{DoxyCompactList}\item 
void \hyperlink{util_2malloc_8h_a499e75f1cbb423edeeeb12b35782098f}{opal\+\_\+malloc\+\_\+finalize} (void)
\begin{DoxyCompactList}\small\item\em Shut down malloc debug output. \end{DoxyCompactList}\item 
\hypertarget{util_2malloc_8h_a8db3cd4de246dba83b67116ede343279}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void $\ast$ {\bfseries opal\+\_\+malloc} (size\+\_\+t size, const char $\ast$file, int line) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+}\label{util_2malloc_8h_a8db3cd4de246dba83b67116ede343279}

\item 
\hypertarget{util_2malloc_8h_af7f5e82dbcfc277d297f81bdd6dd2389}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void $\ast$ {\bfseries opal\+\_\+calloc} (size\+\_\+t nmembers, size\+\_\+t size, const char $\ast$file, int line) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+}\label{util_2malloc_8h_af7f5e82dbcfc277d297f81bdd6dd2389}

\item 
\hypertarget{util_2malloc_8h_a1f11b1d4d3ca096da3f50340fcf03931}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void $\ast$ {\bfseries opal\+\_\+realloc} (void $\ast$ptr, size\+\_\+t size, const char $\ast$file, int line) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+malloc\+\_\+\+\_\+ \+\_\+\+\_\+opal\+\_\+attribute\+\_\+warn\+\_\+unused\+\_\+result\+\_\+\+\_\+}\label{util_2malloc_8h_a1f11b1d4d3ca096da3f50340fcf03931}

\item 
\hypertarget{util_2malloc_8h_a0147effb64da9288c3f6686b3f1e1a2c}{O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void {\bfseries opal\+\_\+free} (void $\ast$addr, const char $\ast$file, int line) \+\_\+\+\_\+opal\+\_\+attribute\+\_\+nonnull\+\_\+\+\_\+(1)}\label{util_2malloc_8h_a0147effb64da9288c3f6686b3f1e1a2c}

\item 
O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void \hyperlink{util_2malloc_8h_aad7ca91ed31cc2d13d780ad65fc3a226}{opal\+\_\+malloc\+\_\+debug} (int level)
\begin{DoxyCompactList}\small\item\em Used to set the debug level for malloc debug. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{util_2malloc_8h_aad7ca91ed31cc2d13d780ad65fc3a226}{\index{util/malloc.\+h@{util/malloc.\+h}!opal\+\_\+malloc\+\_\+debug@{opal\+\_\+malloc\+\_\+debug}}
\index{opal\+\_\+malloc\+\_\+debug@{opal\+\_\+malloc\+\_\+debug}!util/malloc.\+h@{util/malloc.\+h}}
\subsubsection[{opal\+\_\+malloc\+\_\+debug}]{\setlength{\rightskip}{0pt plus 5cm}O\+P\+A\+L\+\_\+\+D\+E\+C\+L\+S\+P\+E\+C void opal\+\_\+malloc\+\_\+debug (
\begin{DoxyParamCaption}
\item[{int}]{level}
\end{DoxyParamCaption}
)}}\label{util_2malloc_8h_aad7ca91ed31cc2d13d780ad65fc3a226}


Used to set the debug level for malloc debug. 


\begin{DoxyParams}{Parameters}
{\em level} & The level of debugging (0 = none, 1 = some, 2 = more)\\
\hline
\end{DoxyParams}
This value defaults to the O\+P\+A\+L\+\_\+\+M\+A\+L\+L\+O\+C\+\_\+\+D\+E\+B\+U\+G\+\_\+\+L\+E\+V\+E\+L. \hypertarget{util_2malloc_8h_a499e75f1cbb423edeeeb12b35782098f}{\index{util/malloc.\+h@{util/malloc.\+h}!opal\+\_\+malloc\+\_\+finalize@{opal\+\_\+malloc\+\_\+finalize}}
\index{opal\+\_\+malloc\+\_\+finalize@{opal\+\_\+malloc\+\_\+finalize}!util/malloc.\+h@{util/malloc.\+h}}
\subsubsection[{opal\+\_\+malloc\+\_\+finalize}]{\setlength{\rightskip}{0pt plus 5cm}void opal\+\_\+malloc\+\_\+finalize (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{util_2malloc_8h_a499e75f1cbb423edeeeb12b35782098f}


Shut down malloc debug output. 

This function is invoked as part of \hyperlink{opal_8h_a554ee75e5c10824fc54af5c67894fc40}{opal\+\_\+finalize()} to shut down the output stream for malloc debug messages. 

References O\+B\+J\+\_\+\+D\+E\+S\+T\+R\+U\+C\+T, and opal\+\_\+output\+\_\+close().



Referenced by opal\+\_\+finalize\+\_\+util().

\hypertarget{util_2malloc_8h_a3a67acc226d876437d6523de5a1eefd2}{\index{util/malloc.\+h@{util/malloc.\+h}!opal\+\_\+malloc\+\_\+init@{opal\+\_\+malloc\+\_\+init}}
\index{opal\+\_\+malloc\+\_\+init@{opal\+\_\+malloc\+\_\+init}!util/malloc.\+h@{util/malloc.\+h}}
\subsubsection[{opal\+\_\+malloc\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}B\+E\+G\+I\+N\+\_\+\+C\+\_\+\+D\+E\+C\+L\+S void opal\+\_\+malloc\+\_\+init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{util_2malloc_8h_a3a67acc226d876437d6523de5a1eefd2}


Initialize malloc debug output. 

This function is invoked to setup a dedicated output stream for malloc debug functions. It does {\itshape not} (currently) do anything other than that (i.\+e., no internal accounting for tracking malloc/free statements, etc.).

It is invoked as part of \hyperlink{opal_8h_a6bb568620041efe29a6e83bd98f9aedc}{opal\+\_\+init()}. Although this function is not {\itshape necessary} for O\+P\+A\+L\+\_\+\+M\+A\+L\+L\+O\+C() and O\+P\+A\+L\+\_\+\+F\+R\+E\+E(), it is strong recommended because no output messages -- regardless of the malloc debug level set by \hyperlink{util_2malloc_8h_aad7ca91ed31cc2d13d780ad65fc3a226}{opal\+\_\+malloc\+\_\+debug()} -- will be displayed unless this function is invoked first. 

References opal\+\_\+output\+\_\+stream\+\_\+t\+::lds\+\_\+is\+\_\+debugging, opal\+\_\+output\+\_\+stream\+\_\+t\+::lds\+\_\+prefix, opal\+\_\+output\+\_\+stream\+\_\+t\+::lds\+\_\+verbose\+\_\+level, opal\+\_\+output\+\_\+stream\+\_\+t\+::lds\+\_\+want\+\_\+stderr, O\+B\+J\+\_\+\+C\+O\+N\+S\+T\+R\+U\+C\+T, and opal\+\_\+output\+\_\+open().



Referenced by opal\+\_\+init\+\_\+util().

