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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 return true; | 348 return true; |
349 } | 349 } |
350 | 350 |
351 | 351 |
352 bool VirtualMemory::Uncommit(void* address, size_t size) { | 352 bool VirtualMemory::Uncommit(void* address, size_t size) { |
353 ASSERT(IsReserved()); | 353 ASSERT(IsReserved()); |
354 return VirtualFree(address, size, MEM_DECOMMIT) != false; | 354 return VirtualFree(address, size, MEM_DECOMMIT) != false; |
355 } | 355 } |
356 | 356 |
357 | 357 |
| 358 bool VirtualMemory::Guard(void* address) { |
| 359 if (NULL == VirtualAlloc(address, |
| 360 OS::CommitPageSize(), |
| 361 MEM_COMMIT, |
| 362 PAGE_READONLY | PAGE_GUARD)) { |
| 363 return false; |
| 364 } |
| 365 return true; |
| 366 } |
| 367 |
| 368 |
358 class Thread::PlatformData : public Malloced { | 369 class Thread::PlatformData : public Malloced { |
359 public: | 370 public: |
360 PlatformData() : thread_(kNoThread) {} | 371 PlatformData() : thread_(kNoThread) {} |
361 pthread_t thread_; // Thread handle for pthread. | 372 pthread_t thread_; // Thread handle for pthread. |
362 }; | 373 }; |
363 | 374 |
364 | 375 |
365 | 376 |
366 | 377 |
367 Thread::Thread(const Options& options) | 378 Thread::Thread(const Options& options) |
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 | 766 |
756 | 767 |
757 void Sampler::Stop() { | 768 void Sampler::Stop() { |
758 ASSERT(IsActive()); | 769 ASSERT(IsActive()); |
759 SamplerThread::RemoveActiveSampler(this); | 770 SamplerThread::RemoveActiveSampler(this); |
760 SetActive(false); | 771 SetActive(false); |
761 } | 772 } |
762 | 773 |
763 | 774 |
764 } } // namespace v8::internal | 775 } } // namespace v8::internal |
OLD | NEW |