diff --git a/include/xo/alloc2/alloc/RAllocator.hpp b/include/xo/alloc2/alloc/RAllocator.hpp index e2ba55d..12d1a78 100644 --- a/include/xo/alloc2/alloc/RAllocator.hpp +++ b/include/xo/alloc2/alloc/RAllocator.hpp @@ -35,6 +35,8 @@ namespace xo { size_type allocated() const noexcept { return O::iface()->allocated(O::data()); } bool contains(const void * p) const noexcept { return O::iface()->contains(O::data(), p); } AllocError last_error() const noexcept { return O::iface()->last_error(O::data()); } + AllocInfo alloc_info(value_type mem) const noexcept { return O::iface()->alloc_info(O::data(), mem); } + //range_type alloc_range(DArena & mm) value_type alloc(size_type z) noexcept { return O::iface()->alloc(O::data(), z); } value_type super_alloc(size_type z) noexcept { return O::iface()->super_alloc(O::data(), z); } @@ -42,7 +44,6 @@ namespace xo { bool complete_flag) noexcept { return O::iface()->sub_alloc(O::data(), z, complete_flag); } bool expand(size_type z) { return O::iface()->expand(O::data(), z); } - AllocInfo alloc_info(value_type mem) { return O::iface()->alloc_info(O::data(), mem); } static bool _valid; }; diff --git a/utest/random_allocs.cpp b/utest/random_allocs.cpp index c2775a5..b3fb514 100644 --- a/utest/random_allocs.cpp +++ b/utest/random_allocs.cpp @@ -4,6 +4,7 @@ **/ #include "random_allocs.hpp" +#include "arena/DArena.hpp" #include "padding.hpp" #include #include @@ -12,6 +13,8 @@ namespace utest { using xo::mm::AllocInfo; + using xo::mm::DArena; + using xo::mm::ArenaConfig; using xo::mm::padding; using xo::rng::xoshiro256ss; using xo::facet::obj; @@ -163,6 +166,12 @@ namespace utest { } + /** scratch arena for iterators **/ + DArena scratch_mm = DArena::map(ArenaConfig{.name_ = "scratch", + .size_ = 4*1024, + .hugepage_z_ = 4*1024 }); + + #ifdef NOT_YET // to verify iteration here, need iterator support in AAllocator /* verify iteration visits all the allocs, exactly once */