From 6c7fd1db481ff10a16ecab958c6542784fa60b9c Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Wed, 30 Oct 2024 09:51:54 -0500 Subject: Use std::byte* instead of void* for allocators. --- test/test_common.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'test/test_common.cpp') 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(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); } -- cgit v1.2.3