OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 // If the memory was reserved with an alignment, this size may be larger | 349 // If the memory was reserved with an alignment, this size may be larger |
350 // than the requested size. | 350 // than the requested size. |
351 size_t size() { return size_; } | 351 size_t size() { return size_; } |
352 | 352 |
353 // Commits real memory. Returns whether the operation succeeded. | 353 // Commits real memory. Returns whether the operation succeeded. |
354 bool Commit(void* address, size_t size, bool is_executable); | 354 bool Commit(void* address, size_t size, bool is_executable); |
355 | 355 |
356 // Uncommit real memory. Returns whether the operation succeeded. | 356 // Uncommit real memory. Returns whether the operation succeeded. |
357 bool Uncommit(void* address, size_t size); | 357 bool Uncommit(void* address, size_t size); |
358 | 358 |
| 359 // Creates a single guard page at the given address. |
| 360 bool Guard(void* address); |
| 361 |
359 void Release() { | 362 void Release() { |
360 ASSERT(IsReserved()); | 363 ASSERT(IsReserved()); |
361 // Notice: Order is important here. The VirtualMemory object might live | 364 // Notice: Order is important here. The VirtualMemory object might live |
362 // inside the allocated region. | 365 // inside the allocated region. |
363 void* address = address_; | 366 void* address = address_; |
364 size_t size = size_; | 367 size_t size = size_; |
365 Reset(); | 368 Reset(); |
366 bool result = ReleaseRegion(address, size); | 369 bool result = ReleaseRegion(address, size); |
367 USE(result); | 370 USE(result); |
368 ASSERT(result); | 371 ASSERT(result); |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 Atomic32 active_; | 697 Atomic32 active_; |
695 PlatformData* data_; // Platform specific data. | 698 PlatformData* data_; // Platform specific data. |
696 int samples_taken_; // Counts stack samples taken. | 699 int samples_taken_; // Counts stack samples taken. |
697 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 700 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
698 }; | 701 }; |
699 | 702 |
700 | 703 |
701 } } // namespace v8::internal | 704 } } // namespace v8::internal |
702 | 705 |
703 #endif // V8_PLATFORM_H_ | 706 #endif // V8_PLATFORM_H_ |
OLD | NEW |