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 | 3647f42c27761472e4ee204bade964e8ffad4679 (patch) | |
tree | 40fa50571360bd3630ddb2f3e153c4a7ef468cd7 /modules/libjar | |
parent | 57bfda37aebdef6a0f7bbb320d508dfaf1a89718 (diff) | |
download | uxp-3647f42c27761472e4ee204bade964e8ffad4679.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 'modules/libjar')
-rw-r--r-- | modules/libjar/nsZipArchive.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/modules/libjar/nsZipArchive.cpp b/modules/libjar/nsZipArchive.cpp index 429de10111..24da13072c 100644 --- a/modules/libjar/nsZipArchive.cpp +++ b/modules/libjar/nsZipArchive.cpp @@ -688,7 +688,9 @@ MOZ_WIN_MEM_TRY_BEGIN // Success means optimized jar layout from bug 559961 is in effect uint32_t readaheadLength = xtolong(startp); if (readaheadLength) { -#if defined(XP_UNIX) +#if defined(XP_SOLARIS) + posix_madvise(const_cast<uint8_t*>(startp), readaheadLength, POSIX_MADV_WILLNEED); +#elif defined(XP_UNIX) madvise(const_cast<uint8_t*>(startp), readaheadLength, MADV_WILLNEED); #elif defined(XP_WIN) if (aFd) { |