From cd632c46f7a9c3fe3d1e760cffaf9a3a2d15bab4 Mon Sep 17 00:00:00 2001 From: Dan Cohen Date: Sun, 3 Dec 2023 10:50:00 +0200 Subject: [PATCH] Expose memory_pool's underlying arena 'owns' method to users of memory_pool itself' --- 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 {