Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(438)

Unified Diff: include/v8.h

Issue 1058253003: Adding V8 api to get memory statistics of spaces in V8::Heap. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Added pimpl class for using vector. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/api.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698