From 739adccafdb7af46afd47fc3ad8cc77a34e56dda Mon Sep 17 00:00:00 2001 From: VDm Date: Sun, 17 Aug 2025 14:57:36 +0400 Subject: [PATCH] fix(memory): set correct pointer size for data block --- common/memory/CDataAllocator.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/memory/CDataAllocator.cpp b/common/memory/CDataAllocator.cpp index 280bdf8..645b9c8 100644 --- a/common/memory/CDataAllocator.cpp +++ b/common/memory/CDataAllocator.cpp @@ -6,8 +6,8 @@ #include CDataAllocator::CDataAllocator(uint32_t bytesPerData, uint32_t dataPerBlock) { - this->m_bytesPerData = std::max(bytesPerData, 4u); - this->m_dataPerBlock = std::max(dataPerBlock, 1u); + this->m_bytesPerData = std::max(bytesPerData, uint32_t(sizeof(Data))); + this->m_dataPerBlock = std::max(dataPerBlock, uint32_t(1)); } CDataAllocator::~CDataAllocator() { @@ -58,7 +58,7 @@ CDataAllocator::Data* CDataAllocator::GetData(int32_t zero, const char* fileName } auto memory = static_cast(SMemAlloc( - this->m_dataPerBlock * this->m_bytesPerData + sizeof(Data), + this->m_dataPerBlock * this->m_bytesPerData + sizeof(Block), fileName, lineNumber, 0));