ALib C++ Library
Library Version: 2412 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
monoallocator.cpp
1// #################################################################################################
2// ALib C++ Library
3//
4// Copyright 2013-2024 A-Worx GmbH, Germany
5// Published under 'Boost Software License' (a free software license, see LICENSE.txt)
6// #################################################################################################
8
9#if ALIB_DEBUG_MONOMEM
10# include <atomic>
11#endif
12#if ALIB_DEBUG_MONOMEM && ALIB_DEBUG_ALLOCATIONS
13# pragma message "Symbols ALIB_DEBUG_MONOMEM and ALIB_DEBUG_ALLOCATIONS are set in parallel. Statistics on allocatoions will be fairly wrong."
14#endif
15
16namespace alib {
17/// This \alibmod implements the concept of <em>"monotonic allocation"</em> by providing the central
18/// classes \alib{monomem;TMonoAllocator} and \alib{monomem;TPoolAllocator}.
19///
20/// Please consult \ref alib_mods_contmono "ALib Module Memory - Programmer's Manual"
21/// for further information.
22namespace monomem {}
23}
24
25
26#if !DOXYGEN
27
28DOX_MARKER( [ALIB_MANUAL_T_HPP_FILE_USAGE] )
29// #################################################################################################
30// Instantiation of MonoAllocator, which is TMonoAllocator<lang::HeapAllocator>.
31// #################################################################################################
32#include "alib/monomem/monoallocator.t.hpp"
33
34namespace alib::monomem { template ALIB_API class TMonoAllocator<lang::HeapAllocator>; }
35DOX_MARKER( [ALIB_MANUAL_T_HPP_FILE_USAGE] )
36
37#include "alib/monomem/globalallocator.hpp"
38
39// #################################################################################################
40// Globals
41// #################################################################################################
42namespace alib::monomem {
43
44 MonoAllocator GLOBAL_ALLOCATOR(ALIB_DBG("Global",) nullptr);
45IF_ALIB_THREADS( RecursiveLock GLOBAL_ALLOCATOR_LOCK; )
46
47} // namespace [alib::monomem]
48
49#endif // !DOXYGEN
#define IF_ALIB_THREADS(...)
Definition alib.hpp:352
#define ALIB_API
Definition alib.hpp:639
#define ALIB_DBG(...)
Definition alib.hpp:390
ALIB_API MonoAllocator GLOBAL_ALLOCATOR
Definition alib.cpp:69
monomem::TMonoAllocator< lang::HeapAllocator > MonoAllocator