diff options
| author | Merry <git@mary.rs> | 2023-01-01 11:14:44 +0000 |
|---|---|---|
| committer | Merry <git@mary.rs> | 2023-01-01 11:40:35 +0000 |
| commit | 192f349e5fe905546218c5dfb5db1b014a73cf14 (patch) | |
| tree | 1a8d937ebaef359a84b7edc29a1110e5f4984c09 /src | |
| parent | d466f5e2b894715d80bd544a2bee31850fd39605 (diff) | |
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')
| -rw-r--r-- | src/common/host_memory.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/host_memory.cpp b/src/common/host_memory.cpp index 909f6cf3fd..4a67f77b22 100644 --- a/src/common/host_memory.cpp +++ b/src/common/host_memory.cpp @@ -393,8 +393,8 @@ public: } // Virtual memory initialization - virtual_base = static_cast<u8*>( - mmap(nullptr, virtual_size, PROT_NONE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0)); + virtual_base = static_cast<u8*>(mmap(nullptr, virtual_size, PROT_NONE, + MAP_PRIVATE | MAP_ANONYMOUS | MAP_NORESERVE, -1, 0)); if (virtual_base == MAP_FAILED) { LOG_CRITICAL(HW_Memory, "mmap failed: {}", strerror(errno)); throw std::bad_alloc{}; |
