summaryrefslogtreecommitdiff
path: root/source/fud_allocator.cpp
diff options
context:
space:
mode:
authorDominick Allen <djallen@librehumanitas.org>2024-11-02 20:45:02 -0500
committerDominick Allen <djallen@librehumanitas.org>2024-11-02 20:45:02 -0500
commite8422002f84dc4313894a5b3136c44a9005081fd (patch)
treeb41633d9f759306fe9c7c01e209780222b47f5df /source/fud_allocator.cpp
parent6c7fd1db481ff10a16ecab958c6542784fa60b9c (diff)
Allocator deallocate is void rather than returning FudStatus.
Diffstat (limited to 'source/fud_allocator.cpp')
-rw-r--r--source/fud_allocator.cpp10
1 files changed, 4 insertions, 6 deletions
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<std::byte*, FudStatus> 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<std::byte*, FudStatus> NullAllocator::allocate(size_t bytes, size_t align
{
static_cast<void>(bytes);
static_cast<void>(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<void>(pointer);
static_cast<void>(bytes);
- return FudStatus::Failure;
}
bool NullAllocator::isEqual(const Allocator& rhs) const