From 3ab8c6240322e5369c92b1984200d6433b540a60 Mon Sep 17 00:00:00 2001 From: cohdan <145435761+cohdan@users.noreply.github.com> Date: Thu, 28 Dec 2023 15:45:51 +0200 Subject: [PATCH] Expose memory_pool's underlying arena 'owns' method to users of memory_pool itself' (#174) --- include/foonathan/memory/memory_pool.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/foonathan/memory/memory_pool.hpp b/include/foonathan/memory/memory_pool.hpp index d764365..a7e5961 100644 --- a/include/foonathan/memory/memory_pool.hpp +++ b/include/foonathan/memory/memory_pool.hpp @@ -222,6 +222,11 @@ namespace foonathan return arena_.get_allocator(); } + /// \returns If `ptr` is in memory owned by the underlying arena. + bool owns(const void* ptr) const noexcept + { + return arena_.owns(ptr); + } private: allocator_info info() const noexcept {