diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-30 09:51:54 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-30 09:51:54 -0500 |
commit | 6c7fd1db481ff10a16ecab958c6542784fa60b9c (patch) | |
tree | e0162f930ec44a7c53b07061311d52910c36e481 /test/test_common.cpp | |
parent | 8dcb1de91e15ff7fc66279cd9cd9ad8a70f624e0 (diff) |
Use std::byte* instead of void* for allocators.
Diffstat (limited to 'test/test_common.cpp')
-rw-r--r-- | test/test_common.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/test/test_common.cpp b/test/test_common.cpp index 784cb0d..778b4b5 100644 --- a/test/test_common.cpp +++ b/test/test_common.cpp @@ -25,12 +25,12 @@ namespace fud { -void* MockFudAlloc::operator()(size_t size) +std::byte* MockFudAlloc::operator()(size_t size) { - return malloc(size); + return static_cast<std::byte*>(malloc(size)); } -void MockFudDealloc::operator()(void* pointer) +void MockFudDealloc::operator()(std::byte* pointer) { return free(pointer); } @@ -39,24 +39,24 @@ MockFudAlloc globalDefaultMockAlloc{}; MockFudDealloc globalDefaultMockDealloc{}; -void* MockFudAllocator::allocate(size_t size) +std::byte* MockFudAllocator::allocate(size_t size) { return (*m_allocator)(size); } -void MockFudAllocator::deallocate(void* pointer) +void MockFudAllocator::deallocate(std::byte* pointer) { return (*m_deallocator)(pointer); } MockFudAllocator globalMockFudAlloc{}; -void* fudAlloc(size_t size) +std::byte* fudAlloc(size_t size) { return globalMockFudAlloc.allocate(size); } -void fudFree(void* ptr) +void fudFree(std::byte* ptr) { return globalMockFudAlloc.deallocate(ptr); } |