xo-reader2 stack: + TypeRegistry

This commit is contained in:
Roland Conybeare 2026-02-15 22:57:15 -05:00
commit 94514bf04f
3 changed files with 9 additions and 7 deletions

View file

@ -16,8 +16,10 @@ namespace xo {
using size_type = std::size_t; using size_type = std::size_t;
MemorySizeInfo() = default; MemorySizeInfo() = default;
MemorySizeInfo(std::string_view name, std::size_t u, std::size_t a, std::size_t c, std::size_t r) MemorySizeInfo(std::string_view name,
: resource_name_{name}, used_{u}, allocated_{a}, committed_{c}, reserved_{r} std::size_t u, std::size_t a, std::size_t c, std::size_t r)
: resource_name_{name},
used_{u}, allocated_{a}, committed_{c}, reserved_{r}
{} {}
static MemorySizeInfo sentinel() { return MemorySizeInfo(); } static MemorySizeInfo sentinel() { return MemorySizeInfo(); }

View file

@ -67,7 +67,7 @@ namespace xo {
DArena::DArena(const ArenaConfig & cfg) DArena::DArena(const ArenaConfig & cfg)
{ {
*this = std::move(map(cfg)); *this = map(cfg);
} }
DArena::DArena(const ArenaConfig & cfg, DArena::DArena(const ArenaConfig & cfg,
@ -290,7 +290,7 @@ namespace xo {
(complete_flag (complete_flag
? alloc_mode::sub_complete ? alloc_mode::sub_complete
: alloc_mode::sub_incomplete), : alloc_mode::sub_incomplete),
typeseq::anon() /*typeseq: ignored*/, typeseq::sentinel() /*typeseq: ignored*/,
0 /*age - ignored */); 0 /*age - ignored */);
} }

View file

@ -147,7 +147,7 @@ namespace xo {
REQUIRE(arena.allocated() == 0); REQUIRE(arena.allocated() == 0);
size_t z0 = 1; size_t z0 = 1;
byte * m0 = arena.alloc(typeseq::anon(), 1); byte * m0 = arena.alloc(typeseq::sentinel(), 1);
REQUIRE(m0); REQUIRE(m0);
REQUIRE(arena.last_error().error_ == error::ok); REQUIRE(arena.last_error().error_ == error::ok);
@ -159,7 +159,7 @@ namespace xo {
REQUIRE(arena.committed() <= arena.reserved()); REQUIRE(arena.committed() <= arena.reserved());
size_t z1 = 16; size_t z1 = 16;
byte * m1 = arena.alloc(typeseq::anon(), z1); byte * m1 = arena.alloc(typeseq::sentinel(), z1);
REQUIRE(m1); REQUIRE(m1);
REQUIRE(arena.last_error().error_ == error::ok); REQUIRE(arena.last_error().error_ == error::ok);
@ -195,7 +195,7 @@ namespace xo {
REQUIRE(arena.allocated() == 0); REQUIRE(arena.allocated() == 0);
size_t z0 = 1; size_t z0 = 1;
byte * m0 = arena.alloc(typeseq::anon(), 1); byte * m0 = arena.alloc(typeseq::sentinel(), 1);
REQUIRE(m0); REQUIRE(m0);