xo-alloc2: tiny work on alloc iterator utest
This commit is contained in:
parent
1ec9759f19
commit
823b1f198e
2 changed files with 11 additions and 1 deletions
|
|
@ -35,6 +35,8 @@ namespace xo {
|
||||||
size_type allocated() const noexcept { return O::iface()->allocated(O::data()); }
|
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); }
|
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()); }
|
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 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); }
|
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(),
|
bool complete_flag) noexcept { return O::iface()->sub_alloc(O::data(),
|
||||||
z, complete_flag); }
|
z, complete_flag); }
|
||||||
bool expand(size_type z) { return O::iface()->expand(O::data(), z); }
|
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;
|
static bool _valid;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@
|
||||||
**/
|
**/
|
||||||
|
|
||||||
#include "random_allocs.hpp"
|
#include "random_allocs.hpp"
|
||||||
|
#include "arena/DArena.hpp"
|
||||||
#include "padding.hpp"
|
#include "padding.hpp"
|
||||||
#include <xo/indentlog/scope.hpp>
|
#include <xo/indentlog/scope.hpp>
|
||||||
#include <xo/indentlog/print/tag.hpp>
|
#include <xo/indentlog/print/tag.hpp>
|
||||||
|
|
@ -12,6 +13,8 @@
|
||||||
|
|
||||||
namespace utest {
|
namespace utest {
|
||||||
using xo::mm::AllocInfo;
|
using xo::mm::AllocInfo;
|
||||||
|
using xo::mm::DArena;
|
||||||
|
using xo::mm::ArenaConfig;
|
||||||
using xo::mm::padding;
|
using xo::mm::padding;
|
||||||
using xo::rng::xoshiro256ss;
|
using xo::rng::xoshiro256ss;
|
||||||
using xo::facet::obj;
|
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
|
#ifdef NOT_YET // to verify iteration here, need iterator support in AAllocator
|
||||||
|
|
||||||
/* verify iteration visits all the allocs, exactly once */
|
/* verify iteration visits all the allocs, exactly once */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue