Compare commits

..
1 Commits
Author SHA1 Message Date
abdelrahman 3d6755d4d4 Apply arena initialisation fixes
Release / release (push) Successful in 19s
2026-11-23 00:44:54 +00:00
4 changed files with 12 additions and 7 deletions

No files matched your search

+6
View File
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased] ## [Unreleased]
## [3.6.1] - 2026-11-23
### Fixed
- Arena initialisation checks
## [3.6.0] - 2026-11-22 ## [3.6.0] - 2026-11-22
### Added ### Added
+1 -1
View File
@@ -1 +1 @@
3.6.0 3.6.1
+2 -3
View File
@@ -38,8 +38,7 @@ typedef void (WpMemTempBeginFunc)(void *alloc_obj);
typedef void (WpMemTempEndFunc)(void *alloc_obj); typedef void (WpMemTempEndFunc)(void *alloc_obj);
typedef WpAllocatorUsage (WpMemQueryUsageFunc)(void *alloc_obj); typedef WpAllocatorUsage (WpMemQueryUsageFunc)(void *alloc_obj);
typedef struct WpAllocator WpAllocator; typedef struct WpAllocator {
struct WpAllocator {
void *obj; void *obj;
WpMemAllocFunc *alloc; WpMemAllocFunc *alloc;
WpMemAllocAlignedFunc *alloc_aligned; WpMemAllocAlignedFunc *alloc_aligned;
@@ -49,7 +48,7 @@ struct WpAllocator {
WpMemTempBeginFunc *temp_begin; WpMemTempBeginFunc *temp_begin;
WpMemTempEndFunc *temp_end; WpMemTempEndFunc *temp_end;
WpMemQueryUsageFunc *query_usage; WpMemQueryUsageFunc *query_usage;
}; } WpAllocator;
#ifdef WP_PLATFORM_CPP #ifdef WP_PLATFORM_CPP
#define wpMemAllocatorInvalid(ALLOCATOR) ([&]() { \ #define wpMemAllocatorInvalid(ALLOCATOR) ([&]() { \
+3 -3
View File
@@ -33,7 +33,7 @@ struct WpArena {
}; };
b8 wpMemArenaInitBuffer(WpArena **arena, u8 *buffer, u64 buffer_size) { b8 wpMemArenaInitBuffer(WpArena **arena, u8 *buffer, u64 buffer_size) {
if (!arena || *arena || buffer_size < sizeof(WpArena)) { if (arena == NULL || *arena != NULL || buffer_size < sizeof(WpArena)) {
return false; return false;
} }
@@ -51,7 +51,7 @@ b8 wpMemArenaInitBuffer(WpArena **arena, u8 *buffer, u64 buffer_size) {
} }
b8 wpMemArenaInitAllocatedCustom(WpArena **arena, u64 base_capacity, WpMemAllocFlags flags, b8 zero_buffer) { b8 wpMemArenaInitAllocatedCustom(WpArena **arena, u64 base_capacity, WpMemAllocFlags flags, b8 zero_buffer) {
if (!arena || *arena || base_capacity == 0) { if (arena == NULL || *arena != NULL || base_capacity == 0) {
return false; return false;
} }
@@ -59,7 +59,7 @@ b8 wpMemArenaInitAllocatedCustom(WpArena **arena, u64 base_capacity, WpMemAllocF
u64 alloc_size = wpMiscUtilsU64RoundUpPow2(size); u64 alloc_size = wpMiscUtilsU64RoundUpPow2(size);
u8 *allocated = (u8 *)wpOsMemAlloc(NULL, alloc_size, WP_MEM_ACCESS_READ_WRITE, flags, u8 *allocated = (u8 *)wpOsMemAlloc(NULL, alloc_size, WP_MEM_ACCESS_READ_WRITE, flags,
zero_buffer ? WP_MEM_INIT_INITIALISED : WP_MEM_INIT_UNINITIALISED); zero_buffer ? WP_MEM_INIT_INITIALISED : WP_MEM_INIT_UNINITIALISED);
if (!allocated) { if (allocated == NULL) {
return false; return false;
} }