diff options
author | Antonio Napolitano <anton@polit.no> | 2023-12-30 19:12:45 +0100 |
---|---|---|
committer | Antonio Napolitano <anton@polit.no> | 2024-01-30 22:15:14 +0100 |
commit | 14b93596a70d1b9381eec3bb6ada7f275e3e99b2 (patch) | |
tree | 92f61664847932e5a21b56aebcb234f10b0709a5 | |
parent | 7ce3ce41b8cc657d31ee28de73d2962a149cd776 (diff) |
masm: Remove unnecessary MADV_DONTNEED on Linux
Calling madvise(MADV_DONTNEED) immediately after creating a new mapping
is redundant, as mmap already returns an uncommitted and zero-filled
memory. Note that even if a memfd is used, it is already zeroed out by
ftruncate.
Change-Id: I326f6b5be20bdc5658b704e35a73b745f00c4272
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | src/3rdparty/masm/wtf/OSAllocatorPosix.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp index e183d434bd..5f95d0e9c8 100644 --- a/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp +++ b/src/3rdparty/masm/wtf/OSAllocatorPosix.cpp @@ -114,8 +114,6 @@ void* OSAllocator::reserveUncommitted(size_t bytes, Usage usage, bool writable, if (result == MAP_FAILED) CRASH(); - while (madvise(result, bytes, MADV_DONTNEED) == -1 && errno == EAGAIN) { } - if (fd != -1) close(fd); #else |