From e8422002f84dc4313894a5b3136c44a9005081fd Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Sat, 2 Nov 2024 20:45:02 -0500 Subject: Allocator deallocate is void rather than returning FudStatus. --- source/fud_allocator.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/fud_allocator.cpp') diff --git a/source/fud_allocator.cpp b/source/fud_allocator.cpp index d5127fa..3f58fb0 100644 --- a/source/fud_allocator.cpp +++ b/source/fud_allocator.cpp @@ -30,13 +30,12 @@ Result FudAllocator::allocate(size_t bytes, size_t alignm return RetType::okay(pointer); } -FudStatus FudAllocator::deallocate(std::byte* pointer, size_t bytes) +void FudAllocator::deallocate(std::byte* pointer, size_t bytes) { if (pointer == nullptr || bytes == 0) { - return FudStatus::ArgumentInvalid; + return; } fudFree(pointer); - return FudStatus::Success; } bool FudAllocator::isEqual(const Allocator& rhs) const @@ -50,14 +49,13 @@ Result NullAllocator::allocate(size_t bytes, size_t align { static_cast(bytes); static_cast(alignment); - return FudError{FudStatus::Failure}; + return FudError{FudStatus::AllocFailure}; } -FudStatus NullAllocator::deallocate(std::byte* pointer, size_t bytes) +void NullAllocator::deallocate(std::byte* pointer, size_t bytes) { static_cast(pointer); static_cast(bytes); - return FudStatus::Failure; } bool NullAllocator::isEqual(const Allocator& rhs) const -- cgit v1.2.3