From 49551e1700b298ddbadb51cf1ba5459f2fdf52b8 Mon Sep 17 00:00:00 2001 From: evoskuil Date: Mon, 19 Aug 2024 20:48:36 -0400 Subject: [PATCH] Add arena start(baseline) parameter. --- include/bitcoin/system/arena.hpp | 10 +++++----- src/arena.cpp | 2 +- test/test.hpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/bitcoin/system/arena.hpp b/include/bitcoin/system/arena.hpp index e50ef83f70..8a0d7998fb 100644 --- a/include/bitcoin/system/arena.hpp +++ b/include/bitcoin/system/arena.hpp @@ -54,7 +54,7 @@ class arena /// Non-linear allocator just returns next address. /// Linear allocator resets to and returns buffer first address. /// Detachable linear allocator allocates buffer returns its first address. - virtual void* start() THROWS = 0; + virtual void* start(size_t baseline) THROWS = 0; /// Non-linear allocator just returns zero. /// Linear allocator returns current allocation size. @@ -62,8 +62,8 @@ class arena virtual size_t detach() THROWS = 0; /// Non-linear and linear allocator is a nop. - /// Detachable linear allocator frees the memory associated with ptr. - virtual void release(void* ptr) NOEXCEPT = 0; + /// Detachable linear allocator frees the memory associated with memory. + virtual void release(void* memory) NOEXCEPT = 0; private: virtual void* do_allocate(size_t bytes, size_t align) THROWS = 0; @@ -93,9 +93,9 @@ class BC_API default_arena final { public: static arena* get() NOEXCEPT; - void* start() THROWS override; + void* start(size_t baseline) THROWS override; size_t detach() THROWS override; - void release(void* ptr) NOEXCEPT override; + void release(void* address) 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 63a85d467f..a8b3cc7ca4 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::start() THROWS +void* default_arena::start(size_t) THROWS { return nullptr; } diff --git a/test/test.hpp b/test/test.hpp index 69e70274d3..bd5df89dc3 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* start() THROWS override + void* start(size_t) THROWS override { return nullptr; } @@ -198,7 +198,7 @@ class mock_arena size_t do_deallocate_align{}; mutable const arena* do_is_equal_address{}; - void* start() THROWS override + void* start(size_t) THROWS override { return nullptr; }