OLD | NEW |
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 Linux goes here. For the POSIX-compatible | 5 // Platform-specific code for Linux 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 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 | 269 |
270 VirtualMemory::~VirtualMemory() { | 270 VirtualMemory::~VirtualMemory() { |
271 if (IsReserved()) { | 271 if (IsReserved()) { |
272 bool result = ReleaseRegion(address(), size()); | 272 bool result = ReleaseRegion(address(), size()); |
273 DCHECK(result); | 273 DCHECK(result); |
274 USE(result); | 274 USE(result); |
275 } | 275 } |
276 } | 276 } |
277 | 277 |
278 | 278 bool VirtualMemory::IsReserved() const { return address_ != NULL; } |
279 bool VirtualMemory::IsReserved() { | |
280 return address_ != NULL; | |
281 } | |
282 | |
283 | 279 |
284 void VirtualMemory::Reset() { | 280 void VirtualMemory::Reset() { |
285 address_ = NULL; | 281 address_ = NULL; |
286 size_ = 0; | 282 size_ = 0; |
287 } | 283 } |
288 | 284 |
289 | 285 |
290 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { | 286 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { |
291 CHECK(InVM(address, size)); | 287 CHECK(InVM(address, size)); |
292 return CommitRegion(address, size, is_executable); | 288 return CommitRegion(address, size, is_executable); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 return munmap(base, size) == 0; | 359 return munmap(base, size) == 0; |
364 } | 360 } |
365 | 361 |
366 | 362 |
367 bool VirtualMemory::HasLazyCommits() { | 363 bool VirtualMemory::HasLazyCommits() { |
368 return true; | 364 return true; |
369 } | 365 } |
370 | 366 |
371 } // namespace base | 367 } // namespace base |
372 } // namespace v8 | 368 } // namespace v8 |
OLD | NEW |