Added missing construction and destruction of StackAllocatorSnapshotData, which is only required when MIJIN_STACK_ALLOCATOR_DEBUG is 2.
This commit is contained in:
parent
6090d5fc74
commit
bf53622b19
@ -326,6 +326,7 @@ public:
|
||||
// couldn't allocate the snapshot
|
||||
return {};
|
||||
}
|
||||
::new (snapshotData) StackAllocatorSnapshotData;
|
||||
StackAllocatorSnapshot snapshot;
|
||||
snapshot.data = snapshotData;
|
||||
if (firstChunk_ != prevFirst)
|
||||
@ -442,6 +443,7 @@ public:
|
||||
Chunk* snapshotChunk = findChunk(snapshot.data);
|
||||
MIJIN_ASSERT_FATAL(snapshotChunk != nullptr, "Snapshot not in chunks?");
|
||||
snapshotChunk->allocated -= calcSnapshotSize(snapshot->numChunks); // note: this might miss the alignment bytes of the snapshot, but that should be fine
|
||||
snapshot.data->~StackAllocatorSnapshotData();
|
||||
}
|
||||
private:
|
||||
void initAndAddChunk(Chunk* newChunk) noexcept
|
||||
|
Loading…
x
Reference in New Issue
Block a user