summaryrefslogtreecommitdiff
path: root/lib/v8.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/v8.js')
-rw-r--r--lib/v8.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/v8.js b/lib/v8.js
index b0b2860a57..f25814bab3 100644
--- a/lib/v8.js
+++ b/lib/v8.js
@@ -15,11 +15,9 @@
'use strict';
const v8binding = process.binding('v8');
-const smalloc = require('internal/smalloc');
const heapStatisticsBuffer =
- smalloc.alloc(v8binding.kHeapStatisticsBufferLength,
- v8binding.kHeapStatisticsBufferType);
+ new Uint32Array(v8binding.heapStatisticsArrayBuffer);
const kTotalHeapSizeIndex = v8binding.kTotalHeapSizeIndex;
const kTotalHeapSizeExecutableIndex = v8binding.kTotalHeapSizeExecutableIndex;
@@ -28,9 +26,9 @@ const kUsedHeapSizeIndex = v8binding.kUsedHeapSizeIndex;
const kHeapSizeLimitIndex = v8binding.kHeapSizeLimitIndex;
exports.getHeapStatistics = function() {
- var buffer = heapStatisticsBuffer;
+ const buffer = heapStatisticsBuffer;
- v8binding.getHeapStatistics(buffer);
+ v8binding.updateHeapStatisticsArrayBuffer();
return {
'total_heap_size': buffer[kTotalHeapSizeIndex],