diff --git a/ext/v8/heap.cc b/ext/v8/heap.cc index d8574dd..cf930b6 100644 --- a/ext/v8/heap.cc +++ b/ext/v8/heap.cc @@ -6,6 +6,7 @@ namespace rr { defineSingletonMethod("new", &initialize). defineMethod("total_heap_size", &total_heap_size). defineMethod("total_heap_size_executable", &total_heap_size_executable). + defineMethod("total_physical_size", &total_physical_size). defineMethod("used_heap_size", &used_heap_size). defineMethod("heap_size_limit", &heap_size_limit). store(&Class); @@ -19,6 +20,9 @@ namespace rr { VALUE HeapStatistics::total_heap_size_executable(VALUE self) { return SIZET2NUM(HeapStatistics(self)->total_heap_size_executable()); } + VALUE HeapStatistics::total_physical_size(VALUE self) { + return SIZET2NUM(HeapStatistics(self)->total_physical_size()); + } VALUE HeapStatistics::used_heap_size(VALUE self) { return SIZET2NUM(HeapStatistics(self)->used_heap_size()); } @@ -28,4 +32,4 @@ namespace rr { template <> void Pointer::unwrap(VALUE value) { Data_Get_Struct(value, class v8::HeapStatistics, pointer); } -} \ No newline at end of file +} diff --git a/ext/v8/rr.h b/ext/v8/rr.h index 4d93dbd..5e001cf 100644 --- a/ext/v8/rr.h +++ b/ext/v8/rr.h @@ -819,6 +819,7 @@ public: static VALUE initialize(VALUE self); static VALUE total_heap_size(VALUE self); static VALUE total_heap_size_executable(VALUE self); + static VALUE total_physical_size(VALUE self); static VALUE used_heap_size(VALUE self); static VALUE heap_size_limit(VALUE self);