ALib C++ Library
Library Version: 2510 R0
Documentation generated by doxygen
Loading...
Searching...
No Matches
monomem.cpp
1// #################################################################################################
2// ALib C++ Library
3//
4// Copyright 2013-2025 A-Worx GmbH, Germany
5// Published under 'Boost Software License' (a free software license, see LICENSE.txt)
6// #################################################################################################
7#include "alib_precompile.hpp"
8#if !defined(ALIB_C20_MODULES) || ((ALIB_C20_MODULES != 0) && (ALIB_C20_MODULES != 1))
9# error "Symbol ALIB_C20_MODULES has to be given to the compiler as either 0 or 1"
10#endif
11#if ALIB_C20_MODULES
12 module;
13#endif
14// ====================================== Global Fragment ======================================
16#if ALIB_DEBUG_MEMORY
17# include <atomic>
18#endif
19#if ALIB_DEBUG_MEMORY && ALIB_DEBUG_ALLOCATIONS
20# pragma message "Symbols ALIB_DEBUG_MEMORY and ALIB_DEBUG_ALLOCATIONS are set in parallel. Statistics on allocatoions will be fairly wrong."
21#endif
22
23#include <cstring>
24// =========================================== Module ==========================================
25#if ALIB_C20_MODULES
26 module ALib.Monomem;
27#else
28# include "ALib.Monomem.H"
29#endif
30// ====================================== Implementation =======================================
31
32namespace alib {
33/// This \alibmod implements the concept of <em>"monotonic allocation"</em> by providing the central
34/// classes \alib{monomem;TMonoAllocator} and \alib{monomem;TPoolAllocator}.
35///
36/// Please consult \ref alib_mods_contmono "ALib Module Memory - Programmer's Manual"
37/// for further information.
38namespace monomem {
39#if !DOXYGEN
41# if !ALIB_SINGLE_THREADED
43# endif
44#endif
45}}
46
47
48#if !DOXYGEN
49DOX_MARKER( [ALIB_MANUAL_T_HPP_FILE_USAGE] )
50// #################################################################################################
51// Instantiation of MonoAllocator, which is TMonoAllocator<lang::HeapAllocator>.
52// #################################################################################################
53#include "alib/monomem/monoallocator.t.inl"
54
56DOX_MARKER( [ALIB_MANUAL_T_HPP_FILE_USAGE] )
57
58#endif // !DOXYGEN
59
60
61#if !DOXYGEN
62// Including the definition of the non-inlined methods of TPoolAllocator.
63// After that, the two predefined versions are explicitly instantiated.
65
66namespace alib::monomem {
67
68template ALIB_DLL class TPoolAllocator<lang::HeapAllocator, ALIB_MONOMEM_POOLALLOCATOR_DEFAULT_ALIGNMENT>;
69template ALIB_DLL class TPoolAllocator< MonoAllocator, ALIB_MONOMEM_POOLALLOCATOR_DEFAULT_ALIGNMENT>;
70
71} // namespace [alib::monomem]
72
73#endif // !DOXYGEN
#define ALIB_DLL
Definition alib.inl:496
#define ALIB_DBG(...)
Definition alib.inl:836
ALIB_DLL TMonoAllocator< lang::HeapAllocator > GLOBAL_ALLOCATOR
ALIB_DLL RecursiveLock GLOBAL_ALLOCATOR_LOCK
threads::RecursiveLock RecursiveLock
Type alias in namespace alib.