Commit d8e37c32 authored by Michaël Zasso's avatar Michaël Zasso Committed by Commit Bot

FreeBSD/Solaris: Fix OS::Allocate

The signature of the method was changed in
implementation was not updated for those platforms.

https: //chromium-review.googlesource.com/c/558876 but the
Change-Id: I507d7877988287c352ee2690bac540f835c19ebf
Reviewed-on: https://chromium-review.googlesource.com/600194Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#47258}
parent 1c9de0b2
......@@ -41,10 +41,10 @@ TimezoneCache* OS::CreateTimezoneCache() {
}
void* OS::Allocate(const size_t requested, size_t* allocated,
OS::MemoryPermission access) {
OS::MemoryPermission access, void* hint) {
const size_t msize = RoundUp(requested, getpagesize());
int prot = GetProtectionFromMemoryPermission(access);
void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0);
void* mbase = mmap(hint, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0);
if (mbase == MAP_FAILED) return NULL;
*allocated = msize;
......
......@@ -59,10 +59,10 @@ double SolarisTimezoneCache::LocalTimeOffset() {
TimezoneCache* OS::CreateTimezoneCache() { return new SolarisTimezoneCache(); }
void* OS::Allocate(const size_t requested, size_t* allocated,
OS::MemoryPermission access) {
OS::MemoryPermission access, void* hint) {
const size_t msize = RoundUp(requested, getpagesize());
int prot = GetProtectionFromMemoryPermission(access);
void* mbase = mmap(NULL, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0);
void* mbase = mmap(hint, msize, prot, MAP_PRIVATE | MAP_ANON, -1, 0);
if (mbase == MAP_FAILED) return NULL;
*allocated = msize;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment