Skip to content

Commit e90c903

Browse files
authored
Merge pull request #676 from evoskuil/master
Add MADV_WILLNEED to macos madvise calls.
2 parents 6966779 + 9643db8 commit e90c903

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/memory/map.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,8 @@ bool map::finalize_(size_t size) NOEXCEPT
617617

618618
// Use 1GB chunks to avoid large-length issues.
619619
constexpr auto chunk = power2(30u);
620-
const auto advice = random_ ? MADV_RANDOM : MADV_SEQUENTIAL;
620+
const auto advice = (random_ ? MADV_RANDOM : MADV_SEQUENTIAL) |
621+
MADV_WILLNEED;
621622

622623
for (auto offset = zero; offset < align; offset += chunk)
623624
{

0 commit comments

Comments
 (0)