Skip to content

Commit cb8635a

Browse files
committed
fix: pl_memory.h temp allocator default to 8 byte alignment (v1.1.2)
1 parent 6e0ce29 commit cb8635a

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

docs/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ the API is complete. It just means we won't break what currently exists.
4545
* Json v1.0.3 (pl_json.h)
4646
* Logging v1.0.1 (pl_log.h)
4747
* Math v1.2.0 (pl_math.h)
48-
* Memory Allocators v1.1.1 (pl_memory.h)
48+
* Memory Allocators v1.1.2 (pl_memory.h)
4949
* Profiling v1.0.0 (pl_profile.h)
5050
* Stl v1.0.0 (pl_stl.h)
5151
* String v1.1.2 (pl_string.h)

libs/pl_memory.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
*/
2121

2222
// library version (format XYYZZ)
23-
#define PL_MEMORY_VERSION "1.1.1"
24-
#define PL_MEMORY_VERSION_NUM 10101
23+
#define PL_MEMORY_VERSION "1.1.2"
24+
#define PL_MEMORY_VERSION_NUM 10102
2525

2626
/*
2727
Index of this file:
@@ -391,6 +391,7 @@ pl_temp_allocator_alloc(plTempAllocator* ptAllocator, size_t szSize)
391391
else
392392
pRequestedMemory = &ptAllocator->acStackBuffer[ptAllocator->szOffset];
393393

394+
szSize = (szSize + 7) & ~7;
394395
ptAllocator->szOffset += szSize;
395396
ptAllocator->szAvailableBytes -= szSize;
396397
return pRequestedMemory;

0 commit comments

Comments
 (0)