26 Commits

Author SHA1 Message Date
abdelrahman 97de0b3eaa Bump version number 2026-06-26 18:10:30 +01:00
abdelrahman 0742c86f1d Add aliases for backward compatibility 2026-06-26 18:10:14 +01:00
abdelrahman ecba164dd7 Rename termcolour 2026-06-26 17:42:15 +01:00
abdelrahman 44c9e20235 Rename shell utils 2026-06-26 17:39:30 +01:00
abdelrahman 1fc93fac24 Rename shell commander 2026-06-26 17:39:05 +01:00
abdelrahman e3856cf584 Rename os mem 2026-06-26 17:33:32 +01:00
abdelrahman c832d5366e Rename file 2026-06-26 17:29:30 +01:00
abdelrahman c29466b863 Rename cpath 2026-06-26 17:28:55 +01:00
abdelrahman 273dbf4535 Rename arena 2026-06-26 17:17:22 +01:00
abdelrahman f0e9da26bd Rename dbl list 2026-06-26 17:16:27 +01:00
abdelrahman 1a0a5b5192 Reformat array 2026-06-26 17:09:32 +01:00
abdelrahman c0d83b5c3f Rename array 2026-06-26 16:54:24 +01:00
abdelrahman c4134c4017 Rename queue 2026-06-26 16:32:09 +01:00
abdelrahman b802aba954 Rename LogLevel 2026-06-26 16:25:38 +01:00
abdelrahman f4bffec947 Rename mem allocator 2026-06-26 16:24:03 +01:00
abdelrahman 99d6404ec4 Rename mem utils 2026-06-26 16:19:46 +01:00
abdelrahman e2b57d4aba Rename Str8 2026-06-26 16:18:46 +01:00
abdelrahman acbfc9088c Start str8 renaming 2026-06-26 16:02:12 +01:00
abdelrahman cd797683d2 Rename log 2026-06-26 15:59:17 +01:00
abdelrahman 28f95b1d41 Rename Tester 2026-06-26 15:53:08 +01:00
abdelrahman cdca775681 Rename PRNG 2026-06-26 15:49:10 +01:00
abdelrahman e4c1068281 Rename UUID 2026-06-26 15:44:14 +01:00
abdelrahman f679017fa7 Rename Misc Utils 2026-06-26 15:38:15 +01:00
abdelrahman 65d99db738 Rename asserts 2026-06-26 15:32:23 +01:00
abdelrahman 61c1ec99e5 Rename aliases 2026-06-26 15:23:36 +01:00
abdelrahman dc348f3e71 Rename platform constants 2026-06-26 15:18:58 +01:00
4 changed files with 6 additions and 60 deletions
+1 -1
View File
@@ -1 +1 @@
2.1.0 2.0.0
+4 -4
View File
@@ -169,13 +169,13 @@ typedef WpDblNode WpStr8Node;
WpDblList *_dblListAlloc(const WpAllocator *allocator, u64 item_size); WpDblList *_dblListAlloc(const WpAllocator *allocator, u64 item_size);
WpDblNode *_dblListNodeAlloc(const WpAllocator *allocator, void *item, u64 item_size); WpDblNode *_dblListNodeAlloc(const WpAllocator *allocator, void *item, u64 item_size);
WpDblNode *_dblListGet(const WpDblList *list, u64 index, u64 item_size); WpDblNode *_dblListGet(const WpDblList *list, u64 index, u64 item_size);
void _dblListPushFront(WpDblList *list, WpDblNode *node, u64 item_size); void _dblListPushFront(WpDblList *list, WpDblNode *node, u64 item_size);
void _dblListPushBack(WpDblList *list, WpDblNode *node, u64 item_size); void _dblListPushBack(WpDblList *list, WpDblNode *node, u64 item_size);
void _dblListInsert(WpDblList *list, WpDblNode *node, u64 index, u64 item_size); void _dblListInsert(WpDblList *list, WpDblNode *node, u64 index, u64 item_size);
WpDblNode *_dblListPopFront(WpDblList *list, u64 item_size); WpDblNode *_dblListPopFront(WpDblList *list, u64 item_size);
WpDblNode *_dblListPopBack(WpDblList *list, u64 item_size); WpDblNode *_dblListPopBack(WpDblList *list, u64 item_size);
WpDblNode *_dblListRemove(WpDblList *list, u64 index, u64 item_size); WpDblNode *_dblListRemove(WpDblList *list, u64 index, u64 item_size);
void _dblListEmpty(WpDblList *list, u64 item_size); void _dblListEmpty(WpDblList *list, u64 item_size);
#ifdef WP_PLATFORM_CPP #ifdef WP_PLATFORM_CPP
END_C_LINKAGE END_C_LINKAGE
+1 -44
View File
@@ -7,72 +7,29 @@
void *wpMemAllocatorAlloc(const WpAllocator *allocator, u64 size) { void *wpMemAllocatorAlloc(const WpAllocator *allocator, u64 size) {
wpDebugAssert(allocator != NULL && (allocator->alloc) != NULL, "`allocator` and `allocator->alloc` should not be NULL"); wpDebugAssert(allocator != NULL && (allocator->alloc) != NULL, "`allocator` and `allocator->alloc` should not be NULL");
if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_ALLOC)) {
return NULL;
}
return allocator->alloc(size, allocator->obj); return allocator->alloc(size, allocator->obj);
} }
void *wpMemAllocatorAllocAligned(const WpAllocator *allocator, u64 size, u64 alignment) { 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"); wpDebugAssert(allocator != NULL && (allocator->alloc_aligned) != NULL, "`allocator` and `allocator->alloc_aligned` should not be NULL");
if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_ALLOC_ALIGNED)) {
return NULL;
}
return allocator->alloc_aligned(size, alignment, allocator->obj); return allocator->alloc_aligned(size, alignment, allocator->obj);
} }
void *wpMemAllocatorRealloc(const WpAllocator *allocator, void *ptr, u64 old_size, u64 new_size) { 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"); wpDebugAssert(allocator != NULL && (allocator->realloc) != NULL, "`allocator` and `allocator->realloc` should not be NULL");
if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_REALLOC)) {
return NULL;
}
return allocator->realloc(ptr, old_size, new_size, allocator->obj); return allocator->realloc(ptr, old_size, new_size, allocator->obj);
} }
void *wpMemAllocatorReallocAligned(const WpAllocator *allocator, void *ptr, u64 old_size, void *wpMemAllocatorReallocAligned(const WpAllocator *allocator, void *ptr, u64 old_size,
u64 new_size, u64 alignment) { u64 new_size, u64 alignment) {
wpDebugAssert(allocator != NULL && (allocator->realloc_aligned) != NULL, "`allocator` and `allocator->realloc_aligned` should not be NULL"); wpDebugAssert(allocator != NULL && (allocator->realloc_aligned) != NULL, "`allocator` and `allocator->realloc_aligned` should not be NULL");
if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_REALLOC_ALIGNED)) {
return NULL;
}
return allocator->realloc_aligned(ptr, old_size, new_size, alignment, allocator->obj); return allocator->realloc_aligned(ptr, old_size, new_size, alignment, allocator->obj);
} }
void wpMemAllocatorFree(const WpAllocator *allocator, void **ptr, u64 size) { void wpMemAllocatorFree(const WpAllocator *allocator, void **ptr, u64 size) {
wpDebugAssert(allocator != NULL && (allocator->free) != NULL, "`allocator` and `allocator->free` should not be NULL"); if (!allocator || !(allocator->free)) {
if (wpMemAllocatorOpSupported(allocator, WP_MEM_OP_FREE)) {
return; return;
} }
allocator->free(ptr, size, allocator->obj); allocator->free(ptr, size, allocator->obj);
} }
b8 wpMemAllocatorOpSupported(const WpAllocator *allocator, WpMemOp op) {
wpDebugAssert(allocator != NULL, "`allocator` should not be NULL");
switch (op) {
case WP_MEM_OP_ALLOC:
return allocator->alloc != NULL;
case WP_MEM_OP_ALLOC_ALIGNED:
return allocator->alloc_aligned != NULL;
case WP_MEM_OP_REALLOC:
return allocator->realloc != NULL;
case WP_MEM_OP_REALLOC_ALIGNED:
return allocator->realloc_aligned != NULL;
case WP_MEM_OP_FREE:
return allocator->free != NULL;
default:
break;
}
return false;
}
-11
View File
@@ -11,16 +11,6 @@
BEGIN_C_LINKAGE BEGIN_C_LINKAGE
#endif // !WP_PLATFORM_CPP #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 *(WpMemAllocFunc)(u64 size, void *alloc_obj);
typedef void *(WpMemAllocAlignedFunc)(u64 size, u64 alignment, 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); typedef void *(WpMemReallocFunc)(void *ptr, u64 old_size, u64 new_size, void *alloc_obj);
@@ -52,7 +42,6 @@ void *wpMemAllocatorRealloc(const WpAllocator *allocator, void *ptr, u64 old_siz
void *wpMemAllocatorReallocAligned(const WpAllocator *allocator, void *ptr, u64 old_size, void *wpMemAllocatorReallocAligned(const WpAllocator *allocator, void *ptr, u64 old_size,
u64 new_size, u64 alignment); u64 new_size, u64 alignment);
void wpMemAllocatorFree(const WpAllocator *allocator, void **ptr, u64 size); void wpMemAllocatorFree(const WpAllocator *allocator, void **ptr, u64 size);
b8 wpMemAllocatorOpSupported(const WpAllocator *allocator, WpMemOp op);
#ifdef WP_PLATFORM_CPP #ifdef WP_PLATFORM_CPP
END_C_LINKAGE END_C_LINKAGE