Add Arena::getMaxSize() and Arena::getUsed(). Make Arena tests discoverable.
Some checks failed
CMake on multiple platforms / build (Release, cl, cl, windows-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, macos-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, clang, clang++, ubuntu-latest) (push) Has been cancelled
CMake on multiple platforms / build (Release, gcc, g++, ubuntu-latest) (push) Has been cancelled

This commit is contained in:
2026-09-11 00:08:24 -07:00
parent a7e97b2461
commit 1cb44e96b1
5 changed files with 33 additions and 19 deletions

View File

@@ -56,6 +56,14 @@ public:
// Reset the arena, potentially also releasing committed pages
void reset();
// Get the actual used size.
// This may differ from the sum of allocations due to alignment requirements.
size_t getUsed() const;
// Get the actual maximum size.
// This may be greater than the maxSize passed into init, due to page size alignment.
size_t getMaxSize() const;
private:
Region m_region;
size_t m_minSize;