Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: src/base/platform/platform-freebsd.cc

Issue 544043002: Next base/macros.h cleanup step. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/base/platform/platform-cygwin.cc ('k') | src/base/platform/platform-linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Platform-specific code for FreeBSD goes here. For the POSIX-compatible 5 // Platform-specific code for FreeBSD goes here. For the POSIX-compatible
6 // parts, the implementation is in platform-posix.cc. 6 // parts, the implementation is in platform-posix.cc.
7 7
8 #include <pthread.h> 8 #include <pthread.h>
9 #include <semaphore.h> 9 #include <semaphore.h>
10 #include <signal.h> 10 #include <signal.h>
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 175
176 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } 176 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
177 177
178 178
179 VirtualMemory::VirtualMemory(size_t size) 179 VirtualMemory::VirtualMemory(size_t size)
180 : address_(ReserveRegion(size)), size_(size) { } 180 : address_(ReserveRegion(size)), size_(size) { }
181 181
182 182
183 VirtualMemory::VirtualMemory(size_t size, size_t alignment) 183 VirtualMemory::VirtualMemory(size_t size, size_t alignment)
184 : address_(NULL), size_(0) { 184 : address_(NULL), size_(0) {
185 DCHECK(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment()))); 185 DCHECK((alignment % OS::AllocateAlignment()) == 0);
186 size_t request_size = RoundUp(size + alignment, 186 size_t request_size = RoundUp(size + alignment,
187 static_cast<intptr_t>(OS::AllocateAlignment())); 187 static_cast<intptr_t>(OS::AllocateAlignment()));
188 void* reservation = mmap(OS::GetRandomMmapAddr(), 188 void* reservation = mmap(OS::GetRandomMmapAddr(),
189 request_size, 189 request_size,
190 PROT_NONE, 190 PROT_NONE,
191 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, 191 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE,
192 kMmapFd, 192 kMmapFd,
193 kMmapFdOffset); 193 kMmapFdOffset);
194 if (reservation == MAP_FAILED) return; 194 if (reservation == MAP_FAILED) return;
195 195
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
298 return munmap(base, size) == 0; 298 return munmap(base, size) == 0;
299 } 299 }
300 300
301 301
302 bool VirtualMemory::HasLazyCommits() { 302 bool VirtualMemory::HasLazyCommits() {
303 // TODO(alph): implement for the platform. 303 // TODO(alph): implement for the platform.
304 return false; 304 return false;
305 } 305 }
306 306
307 } } // namespace v8::base 307 } } // namespace v8::base
OLDNEW
« no previous file with comments | « src/base/platform/platform-cygwin.cc ('k') | src/base/platform/platform-linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698