summaryrefslogtreecommitdiff
path: root/src/common/host_memory.cpp
diff options
context:
space:
mode:
authorGravatar Merry2023-01-01 11:14:44 +0000
committerGravatar Merry2023-01-01 11:40:35 +0000
commit4d7be85e730bc7f46ec5433c425733c4b65a90ed (patch)
tree1a8d937ebaef359a84b7edc29a1110e5f4984c09 /src/common/host_memory.cpp
parentcore: hid: emulated_console: Avoid a crash if frontend does not configure tou... (diff)
downloadyuzu-4d7be85e730bc7f46ec5433c425733c4b65a90ed.tar.gz
yuzu-4d7be85e730bc7f46ec5433c425733c4b65a90ed.tar.xz
yuzu-4d7be85e730bc7f46ec5433c425733c4b65a90ed.zip
host_memory: Allocate virtual_base with MAP_NORESERVE
Specify that we do not require swap to be reserved for this address range; allow overcommitting.
Diffstat (limited to 'src/common/host_memory.cpp')
-rw-r--r--src/common/host_memory.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp
index 909f6cf3f..4a67f77b2 100644
--- a/src/common/host_memory.cpp
+++ b/src/common/host_memory.cpp
@@ -393,8 +393,8 @@ public:
393 } 393 }
394 394
395 // Virtual memory initialization 395 // Virtual memory initialization
396 virtual_base = static_cast<u8*>( 396 virtual_base = static_cast<u8*>(mmap(nullptr, virtual_size, PROT_NONE,
397 mmap(nullptr, virtual_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)); 397 MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0));
398 if (virtual_base == MAP_FAILED) { 398 if (virtual_base == MAP_FAILED) {
399 LOG_CRITICAL(HW_Memory, "mmap failed: {}", strerror(errno)); 399 LOG_CRITICAL(HW_Memory, "mmap failed: {}", strerror(errno));
400 throw std::bad_alloc{}; 400 throw std::bad_alloc{};