summaryrefslogtreecommitdiff
path: root/lib/v8.js
diff options
context:
space:
mode:
authorRoman Klauke <romaaan.git@gmail.com>2015-08-11 20:06:41 +0200
committerBen Noordhuis <info@bnoordhuis.nl>2015-08-11 22:51:50 +0200
commitad7f74453dfe4b13738e13eaf039e73c3daf1fd8 (patch)
treefc0a7fe7183ccc6d80cce5f1cbded965681143be /lib/v8.js
parentae05807f0472fbe73b96660a93ae4b4924eb67ce (diff)
downloadandroid-node-v8-ad7f74453dfe4b13738e13eaf039e73c3daf1fd8.tar.gz
android-node-v8-ad7f74453dfe4b13738e13eaf039e73c3daf1fd8.tar.bz2
android-node-v8-ad7f74453dfe4b13738e13eaf039e73c3daf1fd8.zip
src: add total_available_size to v8 statistics
v8 introduced the new flag `total_available_size` in version 4.4 and upwards. This flag is now available on `v8.getHeapStatistics` with the name `total_available_size`. It contains the total available heap size of v8. Introduced with commit: v8/v8-git-mirror@0a1352a7 PR-URL: https://github.com/nodejs/io.js/pull/2348 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'lib/v8.js')
-rw-r--r--lib/v8.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/v8.js b/lib/v8.js
index f25814bab3..acadfa64e0 100644
--- a/lib/v8.js
+++ b/lib/v8.js
@@ -22,6 +22,7 @@ const heapStatisticsBuffer =
const kTotalHeapSizeIndex = v8binding.kTotalHeapSizeIndex;
const kTotalHeapSizeExecutableIndex = v8binding.kTotalHeapSizeExecutableIndex;
const kTotalPhysicalSizeIndex = v8binding.kTotalPhysicalSizeIndex;
+const kTotalAvailableSize = v8binding.kTotalAvailableSize;
const kUsedHeapSizeIndex = v8binding.kUsedHeapSizeIndex;
const kHeapSizeLimitIndex = v8binding.kHeapSizeLimitIndex;
@@ -34,6 +35,7 @@ exports.getHeapStatistics = function() {
'total_heap_size': buffer[kTotalHeapSizeIndex],
'total_heap_size_executable': buffer[kTotalHeapSizeExecutableIndex],
'total_physical_size': buffer[kTotalPhysicalSizeIndex],
+ 'total_available_size': buffer[kTotalAvailableSize],
'used_heap_size': buffer[kUsedHeapSizeIndex],
'heap_size_limit': buffer[kHeapSizeLimitIndex]
};