Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 404 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { | 404 bool VirtualMemory::Commit(void* address, size_t size, bool is_executable) { |
| 405 return CommitRegion(address, size, is_executable); | 405 return CommitRegion(address, size, is_executable); |
| 406 } | 406 } |
| 407 | 407 |
| 408 | 408 |
| 409 bool VirtualMemory::Uncommit(void* address, size_t size) { | 409 bool VirtualMemory::Uncommit(void* address, size_t size) { |
| 410 return UncommitRegion(address, size); | 410 return UncommitRegion(address, size); |
| 411 } | 411 } |
| 412 | 412 |
| 413 | 413 |
| 414 bool VirtualMemory::Guard(void* address) { | |
| 415 OS::Guard(address, OS::CommitPageSize()); | |
| 416 return true; | |
|
Erik Corry
2012/02/23 12:00:40
You could have put this in the posix file.
| |
| 417 } | |
| 418 | |
| 419 | |
| 414 void* VirtualMemory::ReserveRegion(size_t size) { | 420 void* VirtualMemory::ReserveRegion(size_t size) { |
| 415 void* result = mmap(OS::GetRandomMmapAddr(), | 421 void* result = mmap(OS::GetRandomMmapAddr(), |
| 416 size, | 422 size, |
| 417 PROT_NONE, | 423 PROT_NONE, |
| 418 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, | 424 MAP_PRIVATE | MAP_ANON | MAP_NORESERVE, |
| 419 kMmapFd, | 425 kMmapFd, |
| 420 kMmapFdOffset); | 426 kMmapFdOffset); |
| 421 | 427 |
| 422 if (result == MAP_FAILED) return NULL; | 428 if (result == MAP_FAILED) return NULL; |
| 423 | 429 |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 869 | 875 |
| 870 | 876 |
| 871 void Sampler::Stop() { | 877 void Sampler::Stop() { |
| 872 ASSERT(IsActive()); | 878 ASSERT(IsActive()); |
| 873 SignalSender::RemoveActiveSampler(this); | 879 SignalSender::RemoveActiveSampler(this); |
| 874 SetActive(false); | 880 SetActive(false); |
| 875 } | 881 } |
| 876 | 882 |
| 877 | 883 |
| 878 } } // namespace v8::internal | 884 } } // namespace v8::internal |
| OLD | NEW |