From 5548b5e6ce1ee0f08b103f261391b74624a9a7cd Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 28 Mar 2026 13:16:29 -0400 Subject: [PATCH] xo-gc: in verify report memory ranges for gc space when debug on --- include/xo/arena/MemorySizeInfo.hpp | 7 ++++++- src/arena/DArena.cpp | 2 ++ src/arena/DCircularBuffer.cpp | 2 ++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/xo/arena/MemorySizeInfo.hpp b/include/xo/arena/MemorySizeInfo.hpp index a9649b3..c626201 100644 --- a/include/xo/arena/MemorySizeInfo.hpp +++ b/include/xo/arena/MemorySizeInfo.hpp @@ -31,9 +31,10 @@ namespace xo { MemorySizeInfo() = default; MemorySizeInfo(std::string_view name, std::size_t u, std::size_t a, std::size_t c, std::size_t r, + const void * lo, const void * hi, DetailArrayType * detail) : resource_name_{name}, - used_{u}, allocated_{a}, committed_{c}, reserved_{r}, detail_{detail} + used_{u}, allocated_{a}, committed_{c}, reserved_{r}, lo_{lo}, hi_{hi}, detail_{detail} {} static MemorySizeInfo sentinel() { return MemorySizeInfo(); } @@ -50,6 +51,10 @@ namespace xo { * virtual memory addresses range obtained, whether or not committed **/ std::size_t reserved_ = 0; + /** start address (optional) **/ + const void * lo_ = 0; + /** end address (optional) **/ + const void * hi_ = 0; /** optional histogram with per-data-type counts **/ DetailArrayType * detail_ = nullptr; diff --git a/src/arena/DArena.cpp b/src/arena/DArena.cpp index ebee471..d3ca1f2 100644 --- a/src/arena/DArena.cpp +++ b/src/arena/DArena.cpp @@ -221,6 +221,8 @@ namespace xo { this->allocated(), this->committed(), this->reserved(), + lo_, + hi_, p_detail)); } diff --git a/src/arena/DCircularBuffer.cpp b/src/arena/DCircularBuffer.cpp index bd4dc0c..23bc068 100644 --- a/src/arena/DCircularBuffer.cpp +++ b/src/arena/DCircularBuffer.cpp @@ -87,6 +87,8 @@ namespace xo { occupied_range_.size(), mapped_range_.size(), reserved_range_.size(), + reserved_range_.lo(), + reserved_range_.hi(), nullptr /*detail*/)); pinned_spans_.visit_pools(visitor);