From 4497b888dc54d60517138a41a7fc98884c752235 Mon Sep 17 00:00:00 2001 From: afeher Date: Fri, 13 Sep 2019 10:38:10 -0400 Subject: [PATCH] Do allocate on 0 bytes allocations as standard. --- .gitignore | 3 +++ stdpmr/test_resource.cpp | 9 --------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index a4804ef..44b2191 100644 --- a/.gitignore +++ b/.gitignore @@ -267,3 +267,6 @@ CMakeCache.txt CMakeFiles/ cmake_install.cmake *.sln + +# build +/out diff --git a/stdpmr/test_resource.cpp b/stdpmr/test_resource.cpp index 8ccb749..39f4174 100644 --- a/stdpmr/test_resource.cpp +++ b/stdpmr/test_resource.cpp @@ -449,15 +449,6 @@ void *test_resource::do_allocate(size_t bytes, size_t alignment) } } - if (0 == bytes) { - m_last_allocated_num_bytes_.store(static_cast(0), - memory_order_relaxed); - m_last_allocated_alignment_.store(static_cast(alignment), - memory_order_relaxed); - m_last_allocated_address_.store(nullptr, memory_order_relaxed); - return nullptr; // RETURN - } - AlignedHeader *head = (AlignedHeader *)m_pmr_->allocate( sizeof(AlignedHeader) + bytes + paddingSize); if (!head) {