From 02372cb644e11560c6de3964752238f11bd7d350 Mon Sep 17 00:00:00 2001 From: Abdelrahman Said Date: Sun, 28 Jun 2026 21:46:36 +0100 Subject: [PATCH] Fix mem op supported bug --- VERSION | 2 +- src/base/mem/allocator/mem_allocator.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/VERSION b/VERSION index 7ec1d6d..3e3c2f1 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.1.0 +2.1.1 diff --git a/src/base/mem/allocator/mem_allocator.c b/src/base/mem/allocator/mem_allocator.c index 1fd317c..56b8f2b 100644 --- a/src/base/mem/allocator/mem_allocator.c +++ b/src/base/mem/allocator/mem_allocator.c @@ -8,7 +8,7 @@ void *wpMemAllocatorAlloc(const WpAllocator *allocator, u64 size) { wpDebugAssert(allocator != NULL && (allocator->alloc) != NULL, "`allocator` and `allocator->alloc` should not be NULL"); - if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_ALLOC)) { + if (!wpMemAllocatorOpSupported(allocator, WP_MEM_OP_ALLOC)) { return NULL; } @@ -18,7 +18,7 @@ void *wpMemAllocatorAlloc(const WpAllocator *allocator, u64 size) { void *wpMemAllocatorAllocAligned(const WpAllocator *allocator, u64 size, u64 alignment) { wpDebugAssert(allocator != NULL && (allocator->alloc_aligned) != NULL, "`allocator` and `allocator->alloc_aligned` should not be NULL"); - if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_ALLOC_ALIGNED)) { + if (!wpMemAllocatorOpSupported(allocator, WP_MEM_OP_ALLOC_ALIGNED)) { return NULL; } @@ -28,7 +28,7 @@ void *wpMemAllocatorAllocAligned(const WpAllocator *allocator, u64 size, u64 ali void *wpMemAllocatorRealloc(const WpAllocator *allocator, void *ptr, u64 old_size, u64 new_size) { wpDebugAssert(allocator != NULL && (allocator->realloc) != NULL, "`allocator` and `allocator->realloc` should not be NULL"); - if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_REALLOC)) { + if (!wpMemAllocatorOpSupported(allocator, WP_MEM_OP_REALLOC)) { return NULL; } @@ -39,7 +39,7 @@ void *wpMemAllocatorReallocAligned(const WpAllocator *allocator, void *ptr, u64 u64 new_size, u64 alignment) { wpDebugAssert(allocator != NULL && (allocator->realloc_aligned) != NULL, "`allocator` and `allocator->realloc_aligned` should not be NULL"); - if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_REALLOC_ALIGNED)) { + if (!wpMemAllocatorOpSupported(allocator, WP_MEM_OP_REALLOC_ALIGNED)) { return NULL; } @@ -49,7 +49,7 @@ void *wpMemAllocatorReallocAligned(const WpAllocator *allocator, void *ptr, u64 void wpMemAllocatorFree(const WpAllocator *allocator, void **ptr, u64 size) { wpDebugAssert(allocator != NULL && (allocator->free) != NULL, "`allocator` and `allocator->free` should not be NULL"); - if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_FREE)) { + if (!wpMemAllocatorOpSupported(allocator, WP_MEM_OP_FREE)) { return; }