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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 // Releases the reserved memory, if any, controlled by this VirtualMemory | 377 // Releases the reserved memory, if any, controlled by this VirtualMemory |
| 378 // object. | 378 // object. |
| 379 ~VirtualMemory(); | 379 ~VirtualMemory(); |
| 380 | 380 |
| 381 // Returns whether the memory has been reserved. | 381 // Returns whether the memory has been reserved. |
| 382 bool IsReserved(); | 382 bool IsReserved(); |
| 383 | 383 |
| 384 // Initialize or resets an embedded VirtualMemory object. | 384 // Initialize or resets an embedded VirtualMemory object. |
| 385 void Reset(); | 385 void Reset(); |
| 386 | 386 |
| 387 void Set(void* address, size_t size) { | |
|
danno
2012/12/28 11:58:37
I don't think you need this, see the comment in sp
haitao.feng
2012/12/28 15:04:54
I am using this to get a virtual memory from code
danno
2012/12/28 15:38:10
You don't need a struct, just store the base and s
| |
| 388 address_ = address; | |
| 389 size_ = size; | |
| 390 } | |
| 391 | |
| 387 // Returns the start address of the reserved memory. | 392 // Returns the start address of the reserved memory. |
| 388 // If the memory was reserved with an alignment, this address is not | 393 // If the memory was reserved with an alignment, this address is not |
| 389 // necessarily aligned. The user might need to round it up to a multiple of | 394 // necessarily aligned. The user might need to round it up to a multiple of |
| 390 // the alignment to get the start of the aligned block. | 395 // the alignment to get the start of the aligned block. |
| 391 void* address() { | 396 void* address() { |
| 392 ASSERT(IsReserved()); | 397 ASSERT(IsReserved()); |
| 393 return address_; | 398 return address_; |
| 394 } | 399 } |
| 395 | 400 |
| 396 // Returns the size of the reserved memory. The returned value is only | 401 // Returns the size of the reserved memory. The returned value is only |
| (...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 796 Atomic32 active_; | 801 Atomic32 active_; |
| 797 PlatformData* data_; // Platform specific data. | 802 PlatformData* data_; // Platform specific data. |
| 798 int samples_taken_; // Counts stack samples taken. | 803 int samples_taken_; // Counts stack samples taken. |
| 799 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 804 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 800 }; | 805 }; |
| 801 | 806 |
| 802 | 807 |
| 803 } } // namespace v8::internal | 808 } } // namespace v8::internal |
| 804 | 809 |
| 805 #endif // V8_PLATFORM_H_ | 810 #endif // V8_PLATFORM_H_ |
| OLD | NEW |