\section{include/sphinxbase/listelem\+\_\+alloc.h File Reference}
\label{listelem__alloc_8h}\index{include/sphinxbase/listelem\+\_\+alloc.\+h@{include/sphinxbase/listelem\+\_\+alloc.\+h}}


Fast memory allocator for uniformly sized objects.  


{\ttfamily \#include $<$stdlib.\+h$>$}\\*
{\ttfamily \#include $<$sphinxbase/sphinxbase\+\_\+export.\+h$>$}\\*
{\ttfamily \#include $<$sphinxbase/prim\+\_\+type.\+h$>$}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bf listelem\+\_\+malloc}(le)~\+\_\+\+\_\+listelem\+\_\+malloc\+\_\+\+\_\+((le),\+\_\+\+\_\+\+F\+I\+L\+E\+\_\+\+\_\+,\+\_\+\+\_\+\+L\+I\+N\+E\+\_\+\+\_\+)\label{listelem__alloc_8h_ad0c40e65d9cca0d7ec08fcf416b09af2}

\begin{DoxyCompactList}\small\item\em Allocate a list element and return pointer to it. \end{DoxyCompactList}\item 
\#define {\bf listelem\+\_\+malloc\+\_\+id}(le, oid)~\+\_\+\+\_\+listelem\+\_\+malloc\+\_\+id\+\_\+\+\_\+((le),\+\_\+\+\_\+\+F\+I\+L\+E\+\_\+\+\_\+,\+\_\+\+\_\+\+L\+I\+N\+E\+\_\+\+\_\+,(oid))\label{listelem__alloc_8h_aa9bbb7161aceacdba49b41b189554507}

\begin{DoxyCompactList}\small\item\em Allocate a list element, returning a unique identifier. \end{DoxyCompactList}\item 
\#define {\bf listelem\+\_\+free}(le, el)~{\bf \+\_\+\+\_\+listelem\+\_\+free\+\_\+\+\_\+}((le),(el),\+\_\+\+\_\+\+F\+I\+L\+E\+\_\+\+\_\+,\+\_\+\+\_\+\+L\+I\+N\+E\+\_\+\+\_\+)\label{listelem__alloc_8h_a67de661d7ca552347fa6f03005e25d74}

\begin{DoxyCompactList}\small\item\em Macro of {\bfseries listelem\+\_\+free} \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct {\bf listelem\+\_\+alloc\+\_\+s} {\bf listelem\+\_\+alloc\+\_\+t}\label{listelem__alloc_8h_a3fd3950d7834feaa2bbdf84afb98ce32}

\begin{DoxyCompactList}\small\item\em List element allocator object. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T \\*
{\bf listelem\+\_\+alloc\+\_\+t} $\ast$ {\bf listelem\+\_\+alloc\+\_\+init} (size\+\_\+t elemsize)\label{listelem__alloc_8h_a4b08b49eaa74cbe9a3c95170cee78de7}

\begin{DoxyCompactList}\small\item\em Initialize and return a list element allocator. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void {\bf listelem\+\_\+alloc\+\_\+free} ({\bf listelem\+\_\+alloc\+\_\+t} $\ast$le)\label{listelem__alloc_8h_a94c02e93a0abaa2bd79636cbac6cced2}

\begin{DoxyCompactList}\small\item\em Finalize and release all memory associated with a list element allocator. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void $\ast$ {\bfseries \+\_\+\+\_\+listelem\+\_\+malloc\+\_\+\+\_\+} ({\bf listelem\+\_\+alloc\+\_\+t} $\ast$le, char $\ast$file, int line)\label{listelem__alloc_8h_a04e5512f4dcedc2e84e58108bf61f1ff}

\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void $\ast$ {\bfseries \+\_\+\+\_\+listelem\+\_\+malloc\+\_\+id\+\_\+\+\_\+} ({\bf listelem\+\_\+alloc\+\_\+t} $\ast$le, char $\ast$file, int line, int32 $\ast$out\+\_\+id)\label{listelem__alloc_8h_a45f35edbe5f23773b1624f2ca2ac5e86}

\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void $\ast$ {\bf listelem\+\_\+get\+\_\+item} ({\bf listelem\+\_\+alloc\+\_\+t} $\ast$le, int32 id)\label{listelem__alloc_8h_a74e610ac90e2b0696b2aedef4289d8f3}

\begin{DoxyCompactList}\small\item\em Retrieve a list element by its identifier. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void {\bf \+\_\+\+\_\+listelem\+\_\+free\+\_\+\+\_\+} ({\bf listelem\+\_\+alloc\+\_\+t} $\ast$le, void $\ast$elem, char $\ast$file, int line)\label{listelem__alloc_8h_ab83a7a6fd086c14140ad2c8c4162709b}

\begin{DoxyCompactList}\small\item\em Free list element of given size. \end{DoxyCompactList}\item 
S\+P\+H\+I\+N\+X\+B\+A\+S\+E\+\_\+\+E\+X\+P\+O\+R\+T void {\bf listelem\+\_\+stats} ({\bf listelem\+\_\+alloc\+\_\+t} $\ast$le)\label{listelem__alloc_8h_a838d9361ba76a89a834a7ea6a185b57d}

\begin{DoxyCompactList}\small\item\em Print number of allocation, numer of free operation stats. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Fast memory allocator for uniformly sized objects. 

\begin{DoxyAuthor}{Author}
M K Ravishankar {\tt rkm@cs.\+cmu.\+edu} 
\end{DoxyAuthor}


Definition in file {\bf listelem\+\_\+alloc.\+h}.

