Skip to content

Commit

Permalink
Change arena require to initialize, default to nullptr.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Aug 14, 2024
1 parent ef1cb60 commit ddef928
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/bitcoin/node/block_arena.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class BCN_API block_arena final

block_arena& operator=(block_arena&& other) NOEXCEPT;

void* require(size_t bytes) NOEXCEPT override;
void* initialize() NOEXCEPT override;

private:
void* do_allocate(size_t bytes, size_t align) THROWS override;
Expand Down
8 changes: 3 additions & 5 deletions src/block_arena.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ size_t block_arena::capacity() const NOEXCEPT
}

// Bytes includes any expected alignment.
void* block_arena::require(size_t bytes) NOEXCEPT
void* block_arena::initialize() NOEXCEPT
{
if (bytes > capacity())
offset_ = zero;

return memory_map_ + offset_;
offset_ = zero;
return memory_map_;
}

void* block_arena::do_allocate(size_t bytes, size_t align) THROWS
Expand Down

0 comments on commit ddef928

Please sign in to comment.