Skip to content

Commit

Permalink
Comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
evoskuil committed Jul 10, 2024
1 parent a2aa173 commit c19984c
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions include/bitcoin/system/allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,29 +103,18 @@ class allocator

NODISCARD ALLOCATOR Value* allocate(size_t count) THROWS
{
////const auto bytes = get_byte_size<sizeof(Value)>(count);
////return static_cast<Value*>(arena_->allocate(bytes, alignof(Value)));
return allocate_object<Value>(count);
}

void deallocate(Value* ptr, size_t count) NOEXCEPT
{
////// No need to verify multiplication overflow.
////arena_->deallocate(ptr, count * sizeof(Value), alignof(Value));
return deallocate_object<Value>(ptr, count);
}

/// new_object/delete_object
/// -----------------------------------------------------------------------
/// These allocate & construct / destruct & deallocate.

////template <class Type>
////NODISCARD ALLOCATOR Type* new_object()
////{
//// // Default construction fill is bypassed here.
//// return allocate_object<Type>();
////}

template <class Type, class ...Args>
NODISCARD ALLOCATOR Type* new_object(Args&&... args) THROWS
{
Expand All @@ -148,21 +137,10 @@ class allocator
/// -----------------------------------------------------------------------
/// These neither allocate nor deallocate.

////template <class Type>
////void construct(Type*) NOEXCEPT
////{
//// // Default construction fill is bypassed here.
////}

template <class Type, class ...Args>
void construct(Type* ptr, Args&&... arguments) THROWS
{
////if constexpr (!std::is_trivially_constructible_v<Type, Args...>)
////{
////}

auto at = const_cast<void*>(static_cast<const volatile void*>(ptr));

std::apply
(
// std::apply forwards second argument (tuple) as args to lambda.
Expand Down

0 comments on commit c19984c

Please sign in to comment.