diff options
author | Fangrui Song <i@maskray.me> | 2021-12-30 10:42:28 -0800 |
---|---|---|
committer | Fangrui Song <i@maskray.me> | 2021-12-30 10:42:28 -0800 |
commit | 890e8c8f7e9e448a870224068d6b4181d96a293d (patch) | |
tree | f5c4dc2177dbe583576946b58ff5781e31e47757 /llvm/unittests/Support/CommandLineTest.cpp | |
parent | 25ff448aac63339dc71f92d2e89af672ffdd775b (diff) | |
download | llvm-890e8c8f7e9e448a870224068d6b4181d96a293d.zip llvm-890e8c8f7e9e448a870224068d6b4181d96a293d.tar.gz llvm-890e8c8f7e9e448a870224068d6b4181d96a293d.tar.bz2 |
[Support] Add MemoryBuffer::dontNeedIfMmap
On *NIX systems, this API calls madvise(MADV_DONTNEED) on read-only file mappings.
It should not be used on a writable buffer.
The API is used to implement ld.lld LTO memory saving trick (D116367).
Note: on read-only file mappings, Linux's MADV_DONTNEED semantics match POSIX
POSIX_MADV_DONTNEED and BSD systems' MADV_DONTNEED.
On Windows, VirtualAllocEx MEM_COMMIT/MEM_RESET have similar semantics
but are unfortunately not drop-in replacements. dontNeedIfMmap is currently a no-op.
Reviewed By: aganea
Differential Revision: https://reviews.llvm.org/D116366
Diffstat (limited to 'llvm/unittests/Support/CommandLineTest.cpp')
0 files changed, 0 insertions, 0 deletions