| 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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 size_t size() { return size_; } | 344 size_t size() { return size_; } |
| 345 | 345 |
| 346 // Commits real memory. Returns whether the operation succeeded. | 346 // Commits real memory. Returns whether the operation succeeded. |
| 347 bool Commit(void* address, size_t size, bool is_executable); | 347 bool Commit(void* address, size_t size, bool is_executable); |
| 348 | 348 |
| 349 // Uncommit real memory. Returns whether the operation succeeded. | 349 // Uncommit real memory. Returns whether the operation succeeded. |
| 350 bool Uncommit(void* address, size_t size); | 350 bool Uncommit(void* address, size_t size); |
| 351 | 351 |
| 352 void Release() { | 352 void Release() { |
| 353 ASSERT(IsReserved()); | 353 ASSERT(IsReserved()); |
| 354 // Notice: Order is somportant here. The VirtualMemory object might live | 354 // Notice: Order is important here. The VirtualMemory object might live |
| 355 // inside the allocated region. | 355 // inside the allocated region. |
| 356 void* address = address_; | 356 void* address = address_; |
| 357 size_t size = size_; | 357 size_t size = size_; |
| 358 Reset(); | 358 Reset(); |
| 359 ReleaseRegion(address, size); | 359 bool result = ReleaseRegion(address, size); |
| 360 USE(result); |
| 361 ASSERT(result); |
| 360 } | 362 } |
| 361 | 363 |
| 362 // Assign control of the reserved region to a different VirtualMemory object. | 364 // Assign control of the reserved region to a different VirtualMemory object. |
| 363 // The old object is no longer functional (IsReserved() returns false). | 365 // The old object is no longer functional (IsReserved() returns false). |
| 364 void TakeControl(VirtualMemory* from) { | 366 void TakeControl(VirtualMemory* from) { |
| 365 ASSERT(!IsReserved()); | 367 ASSERT(!IsReserved()); |
| 366 address_ = from->address_; | 368 address_ = from->address_; |
| 367 size_ = from->size_; | 369 size_ = from->size_; |
| 368 from->Reset(); | 370 from->Reset(); |
| 369 } | 371 } |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 Atomic32 active_; | 681 Atomic32 active_; |
| 680 PlatformData* data_; // Platform specific data. | 682 PlatformData* data_; // Platform specific data. |
| 681 int samples_taken_; // Counts stack samples taken. | 683 int samples_taken_; // Counts stack samples taken. |
| 682 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 684 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 683 }; | 685 }; |
| 684 | 686 |
| 685 | 687 |
| 686 } } // namespace v8::internal | 688 } } // namespace v8::internal |
| 687 | 689 |
| 688 #endif // V8_PLATFORM_H_ | 690 #endif // V8_PLATFORM_H_ |
| OLD | NEW |