diff options
author | athenian200 <athenian200@outlook.com> | 2019-10-01 21:36:29 -0500 |
---|---|---|
committer | athenian200 <athenian200@outlook.com> | 2019-10-21 04:53:40 -0500 |
commit | a972c5fcc1ffd4ead5ca9c90b4bd47256993ab78 (patch) | |
tree | 40fa50571360bd3630ddb2f3e153c4a7ef468cd7 /js | |
parent | c8328b2423c3673e0006eb86d190065569b18a71 (diff) | |
download | uxp-a972c5fcc1ffd4ead5ca9c90b4bd47256993ab78.tar.gz |
MoonchildProductions#1251 - Part 7: All the posix_m* memory-related stuff, gathered together.
https://bugzilla.mozilla.org/show_bug.cgi?id=1158445
https://bugzilla.mozilla.org/show_bug.cgi?id=963983
https://bugzilla.mozilla.org/show_bug.cgi?id=1542758
Solaris madvise and malign don't perfectly map to their POSIX counterparts, and some Linux versions (especially Android) don't define the POSIX counterparts at all, so options are limited. Ideally posix_madvise and posix_malign should be the safer and more portable options for all platforms.
Diffstat (limited to 'js')
-rw-r--r-- | js/src/gc/Memory.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp index 268e1e489c..5cf0cd2f79 100644 --- a/js/src/gc/Memory.cpp +++ b/js/src/gc/Memory.cpp @@ -678,7 +678,11 @@ MarkPagesUnused(void* p, size_t size) return false; MOZ_ASSERT(OffsetFromAligned(p, pageSize) == 0); - int result = madvise(p, size, MADV_DONTNEED); +#if defined(XP_SOLARIS) + int result = posix_madvise(p, size, POSIX_MADV_DONTNEED); +#else + int result = madvise(p, size, MADV_DONTNEED); +#endif return result != -1; } |