From 8ad4bb0b2c54259a0206e63f888dcea036d46501 Mon Sep 17 00:00:00 2001 From: Kim Kulling Date: Mon, 15 May 2023 15:09:54 +0200 Subject: [PATCH] Update StackAllocator.inl --- code/Common/StackAllocator.inl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/code/Common/StackAllocator.inl b/code/Common/StackAllocator.inl index d973b7794..2c3164ca7 100644 --- a/code/Common/StackAllocator.inl +++ b/code/Common/StackAllocator.inl @@ -4,7 +4,6 @@ Open Asset Import Library (assimp) Copyright (c) 2006-2022, assimp team - All rights reserved. Redistribution and use of this software in source and binary forms, @@ -45,7 +44,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. using namespace Assimp; - inline StackAllocator::StackAllocator() { } @@ -60,7 +58,7 @@ inline void *StackAllocator::Allocate(size_t byteSize) { // Block size must be at least as large as byteSize, but we want to use this for small allocations anyway. m_blockAllocationSize = std::max(std::min(m_blockAllocationSize * 2, g_maxBytesPerBlock), byteSize); uint8_t *data = new uint8_t[m_blockAllocationSize]; - m_storageBlocks.push_back(data); + m_storageBlocks.emplace_back(data); m_subIndex = byteSize; return data; } @@ -76,7 +74,7 @@ inline void StackAllocator::FreeAll() { for (size_t i = 0; i < m_storageBlocks.size(); i++) { delete [] m_storageBlocks[i]; } - std::deque empty; + std::vector empty; m_storageBlocks.swap(empty); // start over: m_blockAllocationSize = g_startBytesPerBlock;