forked from eden-emu/eden
[heap_tracker] fix map ordering violations
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
84fadd1506
commit
0f5680ece9
2 changed files with 7 additions and 6 deletions
|
@ -168,8 +168,7 @@ void HeapTracker::SplitHeapMap(VAddr offset, size_t size) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void HeapTracker::SplitHeapMapLocked(VAddr offset) {
|
void HeapTracker::SplitHeapMapLocked(VAddr offset) {
|
||||||
auto it = this->GetNearestHeapMapLocked(offset);
|
if (auto it = this->GetNearestHeapMapLocked(offset); it != m_mappings.end() && it->first != offset) {
|
||||||
if (it != m_mappings.end() && it->first != offset) {
|
|
||||||
// Adjust left iterator
|
// Adjust left iterator
|
||||||
auto const orig_size = it->second.size;
|
auto const orig_size = it->second.size;
|
||||||
auto const left_size = offset - it->first;
|
auto const left_size = offset - it->first;
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <shared_mutex>
|
#include <shared_mutex>
|
||||||
#include <ankerl/unordered_dense.h>
|
#include <boost/container/map.hpp>
|
||||||
#include "common/host_memory.h"
|
#include "common/host_memory.h"
|
||||||
|
|
||||||
namespace Common {
|
namespace Common {
|
||||||
|
@ -35,10 +35,12 @@ public:
|
||||||
private:
|
private:
|
||||||
// TODO: You may want to "fake-map" the first 2GB of 64-bit address space
|
// TODO: You may want to "fake-map" the first 2GB of 64-bit address space
|
||||||
// and dedicate it entirely to a recursive PTE mapping :)
|
// and dedicate it entirely to a recursive PTE mapping :)
|
||||||
// However Ankerl is way better than using an RB tree, in all senses
|
// However Ankerl would be way better than using an RB tree, in all senses - but
|
||||||
using AddrTree = ankerl::unordered_dense::map<VAddr, SeparateHeapMap>;
|
// there is a strict requirement for ordering to be imposed accross the map itself
|
||||||
|
// which is not achievable with the unordered property.
|
||||||
|
using AddrTree = boost::container::map<VAddr, SeparateHeapMap>;
|
||||||
AddrTree m_mappings;
|
AddrTree m_mappings;
|
||||||
using TicksTree = ankerl::unordered_dense::map<VAddr, SeparateHeapMap>;
|
using TicksTree = boost::container::map<VAddr, SeparateHeapMap>;
|
||||||
TicksTree m_resident_mappings;
|
TicksTree m_resident_mappings;
|
||||||
private:
|
private:
|
||||||
void SplitHeapMap(VAddr offset, size_t size);
|
void SplitHeapMap(VAddr offset, size_t size);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue