mirror of
https://github.com/thunderbrewhq/common.git
synced 2025-12-12 03:02:29 +00:00
fix(memory): set correct pointer size for data block
This commit is contained in:
parent
e19808b918
commit
739adccafd
1 changed files with 3 additions and 3 deletions
|
|
@ -6,8 +6,8 @@
|
|||
#include <bc/Memory.hpp>
|
||||
|
||||
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<char*>(SMemAlloc(
|
||||
this->m_dataPerBlock * this->m_bytesPerData + sizeof(Data),
|
||||
this->m_dataPerBlock * this->m_bytesPerData + sizeof(Block),
|
||||
fileName,
|
||||
lineNumber,
|
||||
0));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue