From 84630594d5323e72812e0a7f99a095e4cf889c68 Mon Sep 17 00:00:00 2001 From: dzhdan Date: Tue, 17 Dec 2024 16:25:51 +0800 Subject: [PATCH] Nothing --- Source/Shared/StdAllocator.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/Shared/StdAllocator.h b/Source/Shared/StdAllocator.h index c22d1d0b..02f7f2e9 100644 --- a/Source/Shared/StdAllocator.h +++ b/Source/Shared/StdAllocator.h @@ -173,8 +173,7 @@ class Scratch { Scratch(const AllocationCallbacks& allocator, T* mem, size_t num) : m_Allocator(allocator) , m_Mem(mem) - , m_Num(num) - { + , m_Num(num) { m_IsHeap = (num * sizeof(T) + alignof(T)) > MAX_STACK_ALLOC_SIZE; } @@ -187,7 +186,7 @@ class Scratch { return m_Mem; } - inline T& operator [] (size_t i) const { + inline T& operator[](size_t i) const { assert(i < m_Num); return m_Mem[i]; } @@ -200,8 +199,8 @@ class Scratch { }; #define AllocateScratch(device, T, elementNum) \ - { (device).GetStdAllocator().GetInterface(), \ + {(device).GetStdAllocator().GetInterface(), \ ((elementNum) * sizeof(T) + alignof(T)) > MAX_STACK_ALLOC_SIZE \ ? (T*)(device).GetStdAllocator().GetInterface().Allocate((device).GetStdAllocator().GetInterface().userArg, (elementNum) * sizeof(T), alignof(T)) \ : (T*)Align((elementNum) ? (T*)alloca(((elementNum) * sizeof(T) + alignof(T))) : nullptr, alignof(T)), \ - (elementNum) } + (elementNum)}