// $Id: omp_alloc.omh 3757 2015-11-30 12:03:07Z bradbell $
/* --------------------------------------------------------------------------
CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-15 Bradley M. Bell

CppAD is distributed under multiple licenses. This distribution is under
the terms of the
                    GNU General Public License Version 3.

A copy of this license is included in the COPYING file of this distribution.
Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
-------------------------------------------------------------------------- */
$begin omp_alloc$$
$spell
	openmp
	cppad/utility/omp_alloc.hpp
	CppAD
$$

$section A Quick OpenMP Memory Allocator Used by CppAD$$
$mindex multi-threading allocation$$


$head Syntax$$
$code # include <cppad/omp_alloc.hpp>$$

$head Purpose$$
The C++ $code new$$ and $code delete$$ operators are thread safe,
but this means that a thread may have to wait for a lock on these operations.
Once memory is obtained for a thread, the $code omp_alloc$$ memory
allocator keeps that memory $cref omp_available$$ for the thread so that
it can be re-used without waiting for a lock.
All the CppAD memory allocations use this utility.
The $cref omp_free_available$$ function should be used to return memory
to the system (once it is no longer required by a thread).

$head Include$$
The routines in sections below are defined by $code cppad/omp_alloc.hpp$$.
This file is included by
$code cppad/cppad.hpp$$, but it can also be included separately with out
the rest of the $code CppAD$$.

$head Deprecated 2011-08-23$$
Use $cref thread_alloc$$ instead.

$childtable%
	cppad/utility/omp_alloc.hpp%
	test_more/omp_alloc.cpp
%$$

$end
*/
