diff --git a/clay.h b/clay.h index 3d53a9f..88f979f 100644 --- a/clay.h +++ b/clay.h @@ -3819,7 +3819,7 @@ Clay__Warning *Clay__WarningArray_Add(Clay__WarningArray *array, Clay__Warning i void* Clay__Array_Allocate_Arena(int32_t capacity, uint32_t itemSize, Clay_Arena *arena) { size_t totalSizeBytes = capacity * itemSize; - uintptr_t nextAllocOffset = arena->nextAllocation + (64 - (arena->nextAllocation % 64)); + uintptr_t nextAllocOffset = arena->nextAllocation + ((64 - (arena->nextAllocation % 64)) & 63); if (nextAllocOffset + totalSizeBytes <= arena->capacity) { arena->nextAllocation = nextAllocOffset + totalSizeBytes; return (void*)((uintptr_t)arena->memory + (uintptr_t)nextAllocOffset);