xo-alloc2: ++ plumbing for AAllocator / DArena
This commit is contained in:
parent
5964bcf3d5
commit
e0dd9d2a1c
10 changed files with 223 additions and 91 deletions
|
|
@ -3,16 +3,7 @@
|
|||
#include "xo/alloc2/AAllocator.hpp"
|
||||
|
||||
namespace xo {
|
||||
using xo::facet::DVariantPlaceholder;
|
||||
using xo::facet::typeseq;
|
||||
using xo::facet::valid_facet_implementation;
|
||||
|
||||
namespace mm {
|
||||
int32_t
|
||||
IAllocator_Any::s_typeseq = typeseq::id<DVariantPlaceholder>;
|
||||
|
||||
bool
|
||||
IAllocator_Any::_valid = valid_facet_implementation<AAllocator, IAllocator_Any>;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ set(SELF_LIB xo_alloc2)
|
|||
set(SELF_SRCS
|
||||
AAllocator.cpp
|
||||
DArena.cpp
|
||||
IAllocator_Any.cpp
|
||||
IAllocator_DArena.cpp
|
||||
)
|
||||
|
||||
|
|
|
|||
24
src/alloc2/IAllocator_Any.cpp
Normal file
24
src/alloc2/IAllocator_Any.cpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/** @file IAllocator_Any.cpp
|
||||
*
|
||||
* @author Roland Conybeare, Dec 2025
|
||||
**/
|
||||
|
||||
#include "IAllocator_Any.hpp"
|
||||
|
||||
namespace xo {
|
||||
using xo::facet::DVariantPlaceholder;
|
||||
using xo::facet::typeseq;
|
||||
using xo::facet::valid_facet_implementation;
|
||||
|
||||
namespace mm {
|
||||
|
||||
int32_t
|
||||
IAllocator_Any::s_typeseq = typeseq::id<DVariantPlaceholder>();
|
||||
|
||||
bool
|
||||
IAllocator_Any::_valid = valid_facet_implementation<AAllocator, IAllocator_Any>();
|
||||
|
||||
} /*namespace mm*/
|
||||
} /*namespace xo*/
|
||||
|
||||
/* end IAllocator_Any.cpp */
|
||||
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include "IAllocator_DArena.hpp"
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
|
||||
namespace xo {
|
||||
namespace mm {
|
||||
|
|
@ -14,6 +15,11 @@ namespace xo {
|
|||
return s.config_.name_;
|
||||
}
|
||||
|
||||
std::size_t
|
||||
IAllocator_DArena::reserved(const DArena & s) {
|
||||
return s.hi_ - s.lo_;
|
||||
}
|
||||
|
||||
std::size_t
|
||||
IAllocator_DArena::size(const DArena & s) {
|
||||
return s.limit_ - s.lo_;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue