Index: include/v8.h |
diff --git a/include/v8.h b/include/v8.h |
index cdb23b4655d6b2caadde4a9bd16f45d99902e4fd..330574cc82f0f10615d6913f700e3279980c9bde 100644 |
--- a/include/v8.h |
+++ b/include/v8.h |
@@ -18,6 +18,7 @@ |
#include <stddef.h> |
#include <stdint.h> |
#include <stdio.h> |
+#include <vector> |
#include "v8-version.h" |
#include "v8config.h" |
@@ -77,6 +78,7 @@ class External; |
class Function; |
class FunctionTemplate; |
class HeapProfiler; |
+class HeapSpacesStatistics; |
class ImplementationUtilities; |
class Int32; |
class Integer; |
@@ -4877,18 +4879,42 @@ typedef void (*InterruptCallback)(Isolate* isolate, void* data); |
class V8_EXPORT HeapStatistics { |
public: |
HeapStatistics(); |
+ ~HeapStatistics(); |
+ |
+ class SpaceStatistics { |
+ public: |
+ SpaceStatistics(const char* name, |
+ size_t size, |
+ size_t used_size, |
+ size_t available_size, |
+ size_t physical_size) |
+ : space_name(name), |
+ space_size(size), |
+ space_used_size(used_size), |
+ space_avalable_size(available_size), |
+ physical_space_size(physical_size) {} |
+ const char* space_name; |
+ size_t space_size; |
+ size_t space_used_size; |
+ size_t space_avalable_size; |
+ size_t physical_space_size; |
+ }; |
+ |
size_t total_heap_size() { return total_heap_size_; } |
size_t total_heap_size_executable() { return total_heap_size_executable_; } |
size_t total_physical_size() { return total_physical_size_; } |
size_t used_heap_size() { return used_heap_size_; } |
size_t heap_size_limit() { return heap_size_limit_; } |
+ std::vector<SpaceStatistics>* SpacesStatistics(); |
+ |
private: |
size_t total_heap_size_; |
size_t total_heap_size_executable_; |
size_t total_physical_size_; |
size_t used_heap_size_; |
size_t heap_size_limit_; |
+ HeapSpacesStatistics* spaces_statistics_; |
friend class V8; |
friend class Isolate; |