\doxysection{osmo\+\_\+talloc\+\_\+contexts Struct Reference}
\label{structosmo__talloc__contexts}\index{osmo\_talloc\_contexts@{osmo\_talloc\_contexts}}


per-\/thread talloc contexts.  




{\ttfamily \#include $<$talloc.\+h$>$}

\doxysubsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
void $\ast$ \textbf{ global}
\begin{DoxyCompactList}\small\item\em global per-\/thread talloc context. \end{DoxyCompactList}\item 
void $\ast$ \textbf{ select}
\begin{DoxyCompactList}\small\item\em volatile select-\/dispatch context. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
per-\/thread talloc contexts. 

This works around the problem that talloc is not thread-\/safe. However, one can simply have a different set of talloc contexts for each thread, and ensure that allocations made on one thread are always only free\textquotesingle{}d on that very same thread. WARNING\+: Users must make sure they free() on the same thread as they allocate!! 

\doxysubsection{Field Documentation}
\mbox{\label{structosmo__talloc__contexts_a449018d04c339e799cc7ecdb8050a070}} 
\index{osmo\_talloc\_contexts@{osmo\_talloc\_contexts}!global@{global}}
\index{global@{global}!osmo\_talloc\_contexts@{osmo\_talloc\_contexts}}
\doxysubsubsection{global}
{\footnotesize\ttfamily void$\ast$ osmo\+\_\+talloc\+\_\+contexts\+::global}



global per-\/thread talloc context. 



Referenced by \textbf{ osmo\+\_\+ctx\+\_\+init()}.

\mbox{\label{structosmo__talloc__contexts_af69d09ce39713ddbbd56b7747a3215ac}} 
\index{osmo\_talloc\_contexts@{osmo\_talloc\_contexts}!select@{select}}
\index{select@{select}!osmo\_talloc\_contexts@{osmo\_talloc\_contexts}}
\doxysubsubsection{select}
{\footnotesize\ttfamily void$\ast$ osmo\+\_\+talloc\+\_\+contexts\+::select}



volatile select-\/dispatch context. 

This context is completely free\textquotesingle{}d and re-\/created every time the main select loop in \doxyref{osmo\+\_\+select\+\_\+main()}{p.}{group__select_gabc1e2b227ca4c88df091ad2ba22c4231} returns from select(2) and calls per-\/fd callback functions. This allows users of this facility to allocate temporary objects like string buffers, message buffers and the like which are automatically free\textquotesingle{}d when going into the next \doxyref{select()}{p.}{structosmo__talloc__contexts_af69d09ce39713ddbbd56b7747a3215ac} system call 

Referenced by \textbf{ osmo\+\_\+ctx\+\_\+init()}.



The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item 
include/osmocom/core/\textbf{ talloc.\+h}\end{DoxyCompactItemize}
