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 /src/env-inl.h | |
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 'src/env-inl.h')
-rw-r--r-- | src/env-inl.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/env-inl.h b/src/env-inl.h index 83db3d33b6..4b43057de3 100644 --- a/src/env-inl.h +++ b/src/env-inl.h @@ -316,22 +316,22 @@ inline std::vector<int64_t>* Environment::destroy_ids_list() { return &destroy_ids_list_; } -inline uint32_t* Environment::heap_statistics_buffer() const { +inline double* Environment::heap_statistics_buffer() const { CHECK_NE(heap_statistics_buffer_, nullptr); return heap_statistics_buffer_; } -inline void Environment::set_heap_statistics_buffer(uint32_t* pointer) { +inline void Environment::set_heap_statistics_buffer(double* pointer) { CHECK_EQ(heap_statistics_buffer_, nullptr); // Should be set only once. heap_statistics_buffer_ = pointer; } -inline uint32_t* Environment::heap_space_statistics_buffer() const { +inline double* Environment::heap_space_statistics_buffer() const { CHECK_NE(heap_space_statistics_buffer_, nullptr); return heap_space_statistics_buffer_; } -inline void Environment::set_heap_space_statistics_buffer(uint32_t* pointer) { +inline void Environment::set_heap_space_statistics_buffer(double* pointer) { CHECK_EQ(heap_space_statistics_buffer_, nullptr); // Should be set only once. heap_space_statistics_buffer_ = pointer; } |