This commit is contained in:
1 parent
ae7a0806df
commit
3d6755d4d4
4 files changed
+12
-7
No files matched your search
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
## [3.6.1] - 2026-11-23
|
||||
|
||||
### Fixed
|
||||
|
||||
- Arena initialisation checks
|
||||
|
||||
## [3.6.0] - 2026-11-22
|
||||
|
||||
### Added
|
||||
|
||||
@@ -38,8 +38,7 @@ typedef void (WpMemTempBeginFunc)(void *alloc_obj);
|
||||
typedef void (WpMemTempEndFunc)(void *alloc_obj);
|
||||
typedef WpAllocatorUsage (WpMemQueryUsageFunc)(void *alloc_obj);
|
||||
|
||||
typedef struct WpAllocator WpAllocator;
|
||||
struct WpAllocator {
|
||||
typedef struct WpAllocator {
|
||||
void *obj;
|
||||
WpMemAllocFunc *alloc;
|
||||
WpMemAllocAlignedFunc *alloc_aligned;
|
||||
@@ -49,7 +48,7 @@ struct WpAllocator {
|
||||
WpMemTempBeginFunc *temp_begin;
|
||||
WpMemTempEndFunc *temp_end;
|
||||
WpMemQueryUsageFunc *query_usage;
|
||||
};
|
||||
} WpAllocator;
|
||||
|
||||
#ifdef WP_PLATFORM_CPP
|
||||
#define wpMemAllocatorInvalid(ALLOCATOR) ([&]() { \
|
||||
|
||||
@@ -33,7 +33,7 @@ struct WpArena {
|
||||
};
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
if (!arena || *arena || base_capacity == 0) {
|
||||
if (arena == NULL || *arena != NULL || base_capacity == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ b8 wpMemArenaInitAllocatedCustom(WpArena **arena, u64 base_capacity, WpMemAllocF
|
||||
u64 alloc_size = wpMiscUtilsU64RoundUpPow2(size);
|
||||
u8 *allocated = (u8 *)wpOsMemAlloc(NULL, alloc_size, WP_MEM_ACCESS_READ_WRITE, flags,
|
||||
zero_buffer ? WP_MEM_INIT_INITIALISED : WP_MEM_INIT_UNINITIALISED);
|
||||
if (!allocated) {
|
||||
if (allocated == NULL) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user