Add function to check memory op support for allocators
Release / release (push) Successful in 7s

This commit is contained in:
Abdelrahman Said
2026-06-28 14:03:58 +01:00
parent ffdeb5fdc2
commit 5804c5d345
3 changed files with 56 additions and 2 deletions
+11
View File
@@ -11,6 +11,16 @@
BEGIN_C_LINKAGE
#endif // !WP_PLATFORM_CPP
typedef enum {
WP_MEM_OP_ALLOC,
WP_MEM_OP_ALLOC_ALIGNED,
WP_MEM_OP_REALLOC,
WP_MEM_OP_REALLOC_ALIGNED,
WP_MEM_OP_FREE,
COUNT_MEM_OPS
} WpMemOp;
typedef void *(WpMemAllocFunc)(u64 size, void *alloc_obj);
typedef void *(WpMemAllocAlignedFunc)(u64 size, u64 alignment, void *alloc_obj);
typedef void *(WpMemReallocFunc)(void *ptr, u64 old_size, u64 new_size, void *alloc_obj);
@@ -42,6 +52,7 @@ void *wpMemAllocatorRealloc(const WpAllocator *allocator, void *ptr, u64 old_siz
void *wpMemAllocatorReallocAligned(const WpAllocator *allocator, void *ptr, u64 old_size,
u64 new_size, u64 alignment);
void wpMemAllocatorFree(const WpAllocator *allocator, void **ptr, u64 size);
b8 wpMemAllocatorOpSupported(const WpAllocator *allocator, WpMemOp op);
#ifdef WP_PLATFORM_CPP
END_C_LINKAGE