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

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: Made changes. 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 8019a4522b4bafb811263bc39bb53e516fbeb2b6..a44177807298679b5913eb3627ee661cec523fff 100644
--- a/include/v8.h
+++ b/include/v8.h
@@ -18,6 +18,7 @@
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
+#include <vector>
rmcilroy 2015/04/13 17:40:07 We probably don't want to pull in <vector> to be a
#include "v8-version.h"
#include "v8config.h"
@@ -4853,11 +4854,27 @@ typedef void (*InterruptCallback)(Isolate* isolate, void* data);
class V8_EXPORT HeapStatistics {
public:
HeapStatistics();
+
+ class SpaceStatistics {
+ public:
+ SpaceStatistics(size_t size_of_objects, size_t committed_memory,
rmcilroy 2015/04/13 17:40:07 Add a name field so we know what each space each S
rmcilroy 2015/04/13 17:40:08 nit - each arg on a newline
ssid 2015/04/14 16:59:16 Done.
+ size_t available_memory)
+ : size_of_objects_(size_of_objects),
+ committed_memory_(committed_memory),
+ available_memory_(available_memory) {}
+ size_t size_of_objects_;
+ size_t committed_memory_;
+ size_t available_memory_;
rmcilroy 2015/04/13 17:40:07 I think we should make these more obvious names if
ssid 2015/04/14 16:59:16 Done.
+ };
+
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> spaces_statistics() {
+ return spaces_statistics_;
+ }
private:
size_t total_heap_size_;
@@ -4865,6 +4882,7 @@ class V8_EXPORT HeapStatistics {
size_t total_physical_size_;
size_t used_heap_size_;
size_t heap_size_limit_;
+ std::vector<SpaceStatistics> 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