Implement MxMemoryPool (#671)

* Implement MxMemoryPool

* Naming fix

* Annotations and size asserts

* hex padding
This commit is contained in:
MS
2024-03-13 21:44:07 -04:00
committed by GitHub
parent 7edad07d18
commit 331aac73f2
6 changed files with 252 additions and 132 deletions

View File

@@ -8,6 +8,10 @@
#include <algorithm>
DECOMP_SIZE_ASSERT(MxStreamer, 0x2c);
DECOMP_SIZE_ASSERT(MxMemoryPool64, 0x0c);
DECOMP_SIZE_ASSERT(MxMemoryPool128, 0x0c);
DECOMP_SIZE_ASSERT(MxBitset<22>, 0x04);
DECOMP_SIZE_ASSERT(MxBitset<2>, 0x04);
// FUNCTION: LEGO1 0x100b8f00
MxStreamer::MxStreamer()
@@ -18,17 +22,11 @@ MxStreamer::MxStreamer()
// FUNCTION: LEGO1 0x100b9190
MxResult MxStreamer::Create()
{
undefined* b = new undefined[m_subclass1.GetSize() * 0x5800];
m_subclass1.SetBuffer(b);
if (b) {
b = new undefined[m_subclass2.GetSize() * 0x800];
m_subclass2.SetBuffer(b);
if (b) {
return SUCCESS;
}
if (m_pool64.Allocate() || m_pool128.Allocate()) {
return FAILURE;
}
return FAILURE;
return SUCCESS;
}
// FUNCTION: LEGO1 0x100b91d0