diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-17 19:42:29 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-17 19:42:29 -0500 |
commit | 8249b28bea29e8ce17eac12776a60ec3f9e47176 (patch) | |
tree | 98318d7564b5f618cfb59e23cc6b918fcab88ee8 /source/fud_allocator.cpp | |
parent | b32e83ece42cec5aa9dee370bcdf349d23dbc8ba (diff) |
Rename InvalidInput to ArgumentInvalid.
Diffstat (limited to 'source/fud_allocator.cpp')
-rw-r--r-- | source/fud_allocator.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/source/fud_allocator.cpp b/source/fud_allocator.cpp index b5af593..1e4117a 100644 --- a/source/fud_allocator.cpp +++ b/source/fud_allocator.cpp @@ -30,16 +30,18 @@ Result<void*, FudStatus> FudAllocator::allocate(size_t bytes, size_t alignment) return RetType::okay(pointer); } -void FudAllocator::deallocate(void* pointer, size_t bytes, size_t alignment) +FudStatus FudAllocator::deallocate(void* pointer, size_t bytes) { + if (pointer == nullptr || bytes == 0) { + return FudStatus::ArgumentInvalid; + } static_cast<void>(bytes); - static_cast<void>(alignment); fudFree(pointer); + return FudStatus::Success; } bool FudAllocator::isEqual(const Allocator& rhs) const { - /* Is this legit? Or is this a bogus check? */ return &rhs == static_cast<const Allocator*>(this); } |