Chromium Code Reviews| Index: include/v8.h |
| diff --git a/include/v8.h b/include/v8.h |
| index cdb23b4655d6b2caadde4a9bd16f45d99902e4fd..572b2f9fc1ab5c7a938e43e5df8cd4503402db9b 100644 |
| --- a/include/v8.h |
| +++ b/include/v8.h |
| @@ -4895,6 +4895,26 @@ class V8_EXPORT HeapStatistics { |
| }; |
| +class HeapSpaceStatistics { |
| + public: |
| + HeapSpaceStatistics(); |
| + const char* space_name() { return space_name_; } |
| + size_t space_size() { return space_size_;} |
| + size_t space_used_size() { return space_used_size_; } |
| + size_t space_avalable_size() { return space_avalable_size_; } |
| + size_t physical_space_size() { return physical_space_size_; } |
| + |
| + private: |
| + const char* space_name_; |
| + size_t space_size_; |
| + size_t space_used_size_; |
| + size_t space_avalable_size_; |
| + size_t physical_space_size_; |
| + |
| + friend class Isolate; |
| +}; |
| + |
| + |
| class RetainedObjectInfo; |
| @@ -5257,6 +5277,21 @@ class V8_EXPORT Isolate { |
| void GetHeapStatistics(HeapStatistics* heap_statistics); |
| /** |
| + * Returns the number of spaces in the heap. |
| + */ |
| + int NumberOfHeapSpaces(); |
| + |
| + /** |
| + * Get the memory usage of a space in the heap. |
| + * |
| + * \param space_statistics the HeapSpaceStatistics object to fill in |
| + * statistics. |
| + * \param index ranges from 0 - number of spaces in the heap (given by |
| + * NumberOfHeapSpaces()). |
| + */ |
| + void GetHeapSpaceStatistics(HeapSpaceStatistics* space_statistics, int index); |
|
rmcilroy
2015/04/15 10:21:42
return a bool to inform caller of success or failu
ssid
2015/04/15 10:43:57
Done.
|
| + |
| + /** |
| * Get a call stack sample from the isolate. |
| * \param state Execution state. |
| * \param frames Caller allocated buffer to store stack frames. |