mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-30 19:28:40 +09:00
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.
This commit is contained in:
parent
68ee7c2d20
commit
b652dd59ae
6 changed files with 33 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue