diff --git a/include/bitcoin/system/arena.hpp b/include/bitcoin/system/arena.hpp index b71dedcd30..54cd2413d2 100644 --- a/include/bitcoin/system/arena.hpp +++ b/include/bitcoin/system/arena.hpp @@ -51,8 +51,9 @@ class arena return do_is_equal(other); } - /// Require memory capacity, return current or nullptr (custom interface). - virtual void* require(size_t bytes) NOEXCEPT = 0; + /// Non-linear allocator is a nop and returns nullptr. + /// Reset linear allocator and return starting address (not pmr interface). + virtual void* initialize() NOEXCEPT = 0; private: virtual void* do_allocate(size_t bytes, size_t align) THROWS = 0; @@ -82,7 +83,7 @@ class BC_API default_arena final { public: static arena* get() NOEXCEPT; - void* require(size_t bytes) NOEXCEPT override; + void* initialize() NOEXCEPT override; private: void* do_allocate(size_t bytes, size_t align) THROWS override; diff --git a/src/arena.cpp b/src/arena.cpp index 4e9c9f7a50..89b41d7df5 100644 --- a/src/arena.cpp +++ b/src/arena.cpp @@ -57,7 +57,7 @@ bool default_arena::do_is_equal(const arena& other) const NOEXCEPT return &other == this; } -void* default_arena::require(size_t) NOEXCEPT +void* default_arena::initialize() NOEXCEPT { return nullptr; } diff --git a/test/test.hpp b/test/test.hpp index dbd9e7f7b3..ee10f8a291 100644 --- a/test/test.hpp +++ b/test/test.hpp @@ -127,7 +127,7 @@ class reporting_arena size_t dec_count{}; size_t dec_bytes{}; - void* require(size_t) NOEXCEPT override + void* initialize() NOEXCEPT override { return nullptr; } @@ -189,7 +189,7 @@ class mock_arena size_t do_deallocate_align{}; mutable const arena* do_is_equal_address{}; - void* require(size_t) NOEXCEPT override + void* initialize() NOEXCEPT override { return nullptr; }