diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2016-12-09 00:17:14 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2016-12-11 14:45:52 +0100 |
commit | aa77b767b6ba3d047ec946df5f65d1f835a9796a (patch) | |
tree | 49f899ed3c3923ea80056a907c4a23a1f0b13c8b /lib/v8.js | |
parent | 7c2dbd13b595a266b63ab02fb7d820c08ecb6eb5 (diff) | |
download | android-node-v8-aa77b767b6ba3d047ec946df5f65d1f835a9796a.tar.gz android-node-v8-aa77b767b6ba3d047ec946df5f65d1f835a9796a.tar.bz2 android-node-v8-aa77b767b6ba3d047ec946df5f65d1f835a9796a.zip |
lib,src: support values > 4GB in heap statistics
We were transporting the heap statistics as uint32 values to JS land but
those wrap around for values > 4 GB. Use 64 bits floats instead, those
should last us a while.
Fixes: https://github.com/nodejs/node/issues/10185
PR-URL: https://github.com/nodejs/node/pull/10186
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'lib/v8.js')
-rw-r--r-- | lib/v8.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -18,7 +18,7 @@ const v8binding = process.binding('v8'); // Properties for heap statistics buffer extraction. const heapStatisticsBuffer = - new Uint32Array(v8binding.heapStatisticsArrayBuffer); + new Float64Array(v8binding.heapStatisticsArrayBuffer); const kTotalHeapSizeIndex = v8binding.kTotalHeapSizeIndex; const kTotalHeapSizeExecutableIndex = v8binding.kTotalHeapSizeExecutableIndex; const kTotalPhysicalSizeIndex = v8binding.kTotalPhysicalSizeIndex; @@ -31,7 +31,7 @@ const kPeakMallocedMemoryIndex = v8binding.kPeakMallocedMemoryIndex; // Properties for heap space statistics buffer extraction. const heapSpaceStatisticsBuffer = - new Uint32Array(v8binding.heapSpaceStatisticsArrayBuffer); + new Float64Array(v8binding.heapSpaceStatisticsArrayBuffer); const kHeapSpaces = v8binding.kHeapSpaces; const kNumberOfHeapSpaces = kHeapSpaces.length; const kHeapSpaceStatisticsPropertiesCount = |