2
0
mirror of https://github.com/Laupetin/OpenAssetTools.git synced 2026-03-16 18:03:03 +00:00

refactor: fill structs in templates when writing on x64 hosts

This commit is contained in:
Jan Laupetin
2026-01-10 01:08:04 +00:00
parent 257ef39b20
commit 7dffc77ed7
6 changed files with 384 additions and 44 deletions

View File

@@ -284,8 +284,8 @@ namespace
assert(m_block_stack.top()->m_type == XBlockType::BLOCK_TYPE_NORMAL);
uintptr_t ptr = 0;
ptr |= static_cast<uintptr_t>(m_block_stack.top()->m_index) << (sizeof(uintptr_t) * 8 - m_block_bit_count);
ptr |= m_block_stack.top()->m_buffer_size & (UINTPTR_MAX >> m_block_bit_count);
ptr |= static_cast<uintptr_t>(m_block_stack.top()->m_index) << (m_pointer_byte_count * 8 - m_block_bit_count);
ptr |= m_block_stack.top()->m_buffer_size & (UINTPTR_MAX >> (m_block_bit_count + (sizeof(uintptr_t) - m_pointer_byte_count) * 8));
ptr++;
return ptr;
@@ -295,9 +295,9 @@ namespace
{
PushBlock(m_insert_block->m_index);
Align(sizeof(uintptr_t));
Align(m_pointer_byte_count);
const auto result = GetCurrentZonePointer();
IncBlockPos(sizeof(uintptr_t));
IncBlockPos(m_pointer_byte_count);
PopBlock();

View File

@@ -6,6 +6,7 @@
#include <cassert>
#include <cstddef>
#include <cstring>
#include <memory>
#include <typeindex>
#include <typeinfo>