mirror of
https://github.com/RPCSX/rpcsx.git
synced 2026-01-20 15:40:30 +01:00
orbis: vmem: merge direct regions
merge anonymous regions
This commit is contained in:
parent
659ad9d045
commit
9cb9f4c21e
|
|
@ -56,14 +56,24 @@ struct VirtualMemoryAllocation {
|
|||
isRelated(const VirtualMemoryAllocation &other, rx::AddressRange selfRange,
|
||||
[[maybe_unused]] rx::AddressRange rightRange) const {
|
||||
if (flags != other.flags || flagsEx != other.flagsEx ||
|
||||
prot != other.prot || type != other.type || device != other.device ||
|
||||
name != other.name) {
|
||||
prot != other.prot || type != other.type || device != other.device) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!isAllocated()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool isAnon = std::string_view(name).starts_with("anon:");
|
||||
|
||||
if (isAnon) {
|
||||
if (!std::string_view(other.name).starts_with("anon:")) {
|
||||
return false;
|
||||
}
|
||||
} else if (name != other.name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (device == nullptr || flags == orbis::vmem::BlockFlags::PooledMemory) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -450,8 +460,6 @@ std::pair<rx::AddressRange, orbis::ErrorCode> orbis::vmem::mapFile(
|
|||
return {{}, ErrorCode::INVAL};
|
||||
}
|
||||
|
||||
allocFlags |= AllocationFlags::NoMerge;
|
||||
|
||||
if (prot) {
|
||||
blockFlags |= BlockFlags::Commited;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue