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

Side by Side Diff: src/platform-solaris.cc

Issue 14162004: Unified the structure of VirtualMemory implementations across platforms a bit. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 8 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/platform-openbsd.cc ('k') | src/platform-win32.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 } 321 }
322 322
323 323
324 // Constants used for mmap. 324 // Constants used for mmap.
325 static const int kMmapFd = -1; 325 static const int kMmapFd = -1;
326 static const int kMmapFdOffset = 0; 326 static const int kMmapFdOffset = 0;
327 327
328 328
329 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { } 329 VirtualMemory::VirtualMemory() : address_(NULL), size_(0) { }
330 330
331 VirtualMemory::VirtualMemory(size_t size) { 331
332 address_ = ReserveRegion(size); 332 VirtualMemory::VirtualMemory(size_t size)
333 size_ = size; 333 : address_(ReserveRegion(size)), size_(size) { }
334 }
335 334
336 335
337 VirtualMemory::VirtualMemory(size_t size, size_t alignment) 336 VirtualMemory::VirtualMemory(size_t size, size_t alignment)
338 : address_(NULL), size_(0) { 337 : address_(NULL), size_(0) {
339 ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment()))); 338 ASSERT(IsAligned(alignment, static_cast<intptr_t>(OS::AllocateAlignment())));
340 size_t request_size = RoundUp(size + alignment, 339 size_t request_size = RoundUp(size + alignment,
341 static_cast<intptr_t>(OS::AllocateAlignment())); 340 static_cast<intptr_t>(OS::AllocateAlignment()));
342 void* reservation = mmap(OS::GetRandomMmapAddr(), 341 void* reservation = mmap(OS::GetRandomMmapAddr(),
343 request_size, 342 request_size,
344 PROT_NONE, 343 PROT_NONE,
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 } 896 }
898 897
899 898
900 void Sampler::Stop() { 899 void Sampler::Stop() {
901 ASSERT(IsActive()); 900 ASSERT(IsActive());
902 SignalSender::RemoveActiveSampler(this); 901 SignalSender::RemoveActiveSampler(this);
903 SetActive(false); 902 SetActive(false);
904 } 903 }
905 904
906 } } // namespace v8::internal 905 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698