summaryrefslogtreecommitdiffstats
path: root/vespalib
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-01-04 15:12:29 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2023-01-04 15:12:29 +0000
commitb850211b54a2e3073ec9fe38ce35222ce4eedfb9 (patch)
treefb87d028b89e3feee835d17c85ebfeb42d968ae9 /vespalib
parent6ff9771ac01d5f31489a135a960a295269ff348b (diff)
Only for linux.
Diffstat (limited to 'vespalib')
-rw-r--r--vespalib/src/vespa/vespalib/util/mmap_file_allocator.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/vespalib/src/vespa/vespalib/util/mmap_file_allocator.cpp b/vespalib/src/vespa/vespalib/util/mmap_file_allocator.cpp
index 6dd2a853e51..8c89f6745e4 100644
--- a/vespalib/src/vespa/vespalib/util/mmap_file_allocator.cpp
+++ b/vespalib/src/vespa/vespalib/util/mmap_file_allocator.cpp
@@ -62,8 +62,10 @@ MmapFileAllocator::alloc(size_t sz) const
assert(ins_res.second);
int retval = madvise(buf, sz, MADV_RANDOM);
assert(retval == 0);
+#ifdef __linux__
retval = madvise(buf, sz, MADV_DONTDUMP);
assert(retval == 0);
+#endif
return PtrAndSize(buf, sz);
}