| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9916ee8 commit 6e8d627
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ const v8binding = process.binding('v8'); | |||
| 18 | 18 | ||
| 19 | 19 | // Properties for heap statistics buffer extraction. | |
| 20 | 20 | const heapStatisticsBuffer = | |
| 21 | - new Uint32Array(v8binding.heapStatisticsArrayBuffer); | ||
| 21 | + new Float64Array(v8binding.heapStatisticsArrayBuffer); | ||
| 22 | 22 | const kTotalHeapSizeIndex = v8binding.kTotalHeapSizeIndex; | |
| 23 | 23 | const kTotalHeapSizeExecutableIndex = v8binding.kTotalHeapSizeExecutableIndex; | |
| 24 | 24 | const kTotalPhysicalSizeIndex = v8binding.kTotalPhysicalSizeIndex; | |
@@ -31,7 +31,7 @@ const kPeakMallocedMemoryIndex = v8binding.kPeakMallocedMemoryIndex; | |||
| 31 | 31 | ||
| 32 | 32 | // Properties for heap space statistics buffer extraction. | |
| 33 | 33 | const heapSpaceStatisticsBuffer = | |
| 34 | - new Uint32Array(v8binding.heapSpaceStatisticsArrayBuffer); | ||
| 34 | + new Float64Array(v8binding.heapSpaceStatisticsArrayBuffer); | ||
| 35 | 35 | const kHeapSpaces = v8binding.kHeapSpaces; | |
| 36 | 36 | const kNumberOfHeapSpaces = kHeapSpaces.length; | |
| 37 | 37 | const kHeapSpaceStatisticsPropertiesCount = | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -329,22 +329,22 @@ inline std::vector<int64_t>* Environment::destroy_ids_list() { | |||
| 329 | 329 | return &destroy_ids_list_; | |
| 330 | 330 | } | |
| 331 | 331 | ||
| 332 | - inline uint32_t* Environment::heap_statistics_buffer() const { | ||
| 332 | + inline double* Environment::heap_statistics_buffer() const { | ||
| 333 | 333 | CHECK_NE(heap_statistics_buffer_, nullptr); | |
| 334 | 334 | return heap_statistics_buffer_; | |
| 335 | 335 | } | |
| 336 | 336 | ||
| 337 | - inline void Environment::set_heap_statistics_buffer(uint32_t* pointer) { | ||
| 337 | + inline void Environment::set_heap_statistics_buffer(double* pointer) { | ||
| 338 | 338 | CHECK_EQ(heap_statistics_buffer_, nullptr); // Should be set only once. | |
| 339 | 339 | heap_statistics_buffer_ = pointer; | |
| 340 | 340 | } | |
| 341 | 341 | ||
| 342 | - inline uint32_t* Environment::heap_space_statistics_buffer() const { | ||
| 342 | + inline double* Environment::heap_space_statistics_buffer() const { | ||
| 343 | 343 | CHECK_NE(heap_space_statistics_buffer_, nullptr); | |
| 344 | 344 | return heap_space_statistics_buffer_; | |
| 345 | 345 | } | |
| 346 | 346 | ||
| 347 | - inline void Environment::set_heap_space_statistics_buffer(uint32_t* pointer) { | ||
| 347 | + inline void Environment::set_heap_space_statistics_buffer(double* pointer) { | ||
| 348 | 348 | CHECK_EQ(heap_space_statistics_buffer_, nullptr); // Should be set only once. | |
| 349 | 349 | heap_space_statistics_buffer_ = pointer; | |
| 350 | 350 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -469,11 +469,11 @@ class Environment { | |||
| 469 | 469 | // List of id's that have been destroyed and need the destroy() cb called. | |
| 470 | 470 | inline std::vector<int64_t>* destroy_ids_list(); | |
| 471 | 471 | ||
| 472 | - inline uint32_t* heap_statistics_buffer() const; | ||
| 473 | - inline void set_heap_statistics_buffer(uint32_t* pointer); | ||
| 472 | + inline double* heap_statistics_buffer() const; | ||
| 473 | + inline void set_heap_statistics_buffer(double* pointer); | ||
| 474 | 474 | ||
| 475 | - inline uint32_t* heap_space_statistics_buffer() const; | ||
| 476 | - inline void set_heap_space_statistics_buffer(uint32_t* pointer); | ||
| 475 | + inline double* heap_space_statistics_buffer() const; | ||
| 476 | + inline void set_heap_space_statistics_buffer(double* pointer); | ||
| 477 | 477 | ||
| 478 | 478 | inline char* http_parser_buffer() const; | |
| 479 | 479 | inline void set_http_parser_buffer(char* buffer); | |
@@ -581,8 +581,8 @@ class Environment { | |||
| 581 | 581 | &HandleCleanup::handle_cleanup_queue_> handle_cleanup_queue_; | |
| 582 | 582 | int handle_cleanup_waiting_; | |
| 583 | 583 | ||
| 584 | - uint32_t* heap_statistics_buffer_ = nullptr; | ||
| 585 | - uint32_t* heap_space_statistics_buffer_ = nullptr; | ||
| 584 | + double* heap_statistics_buffer_ = nullptr; | ||
| 585 | + double* heap_space_statistics_buffer_ = nullptr; | ||
| 586 | 586 | ||
| 587 | 587 | char* http_parser_buffer_; | |
| 588 | 588 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,8 +57,8 @@ void UpdateHeapStatisticsArrayBuffer(const FunctionCallbackInfo<Value>& args) { | |||
| 57 | 57 | Environment* env = Environment::GetCurrent(args); | |
| 58 | 58 | HeapStatistics s; | |
| 59 | 59 | env->isolate()->GetHeapStatistics(&s); | |
| 60 | - uint32_t* const buffer = env->heap_statistics_buffer(); | ||
| 61 | - #define V(index, name, _) buffer[index] = static_cast<uint32_t>(s.name()); | ||
| 60 | + double* const buffer = env->heap_statistics_buffer(); | ||
| 61 | + #define V(index, name, _) buffer[index] = static_cast<double>(s.name()); | ||
| 62 | 62 | HEAP_STATISTICS_PROPERTIES(V) | |
| 63 | 63 | #undef V | |
| 64 | 64 | } | |
@@ -68,13 +68,13 @@ void UpdateHeapSpaceStatisticsBuffer(const FunctionCallbackInfo<Value>& args) { | |||
| 68 | 68 | Environment* env = Environment::GetCurrent(args); | |
| 69 | 69 | HeapSpaceStatistics s; | |
| 70 | 70 | Isolate* const isolate = env->isolate(); | |
| 71 | - uint32_t* buffer = env->heap_space_statistics_buffer(); | ||
| 71 | + double* buffer = env->heap_space_statistics_buffer(); | ||
| 72 | 72 | ||
| 73 | 73 | for (size_t i = 0; i < number_of_heap_spaces; i++) { | |
| 74 | 74 | isolate->GetHeapSpaceStatistics(&s, i); | |
| 75 | 75 | size_t const property_offset = i * kHeapSpaceStatisticsPropertiesCount; | |
| 76 | 76 | #define V(index, name, _) buffer[property_offset + index] = \ | |
| 77 | - static_cast<uint32_t>(s.name()); | ||
| 77 | + static_cast<double>(s.name()); | ||
| 78 | 78 | HEAP_SPACE_STATISTICS_PROPERTIES(V) | |
| 79 | 79 | #undef V | |
| 80 | 80 | } | |
@@ -103,7 +103,7 @@ void InitializeV8Bindings(Local<Object> target, | |||
| 103 | 103 | "updateHeapStatisticsArrayBuffer", | |
| 104 | 104 | UpdateHeapStatisticsArrayBuffer); | |
| 105 | 105 | ||
| 106 | - env->set_heap_statistics_buffer(new uint32_t[kHeapStatisticsPropertiesCount]); | ||
| 106 | + env->set_heap_statistics_buffer(new double[kHeapStatisticsPropertiesCount]); | ||
| 107 | 107 | ||
| 108 | 108 | const size_t heap_statistics_buffer_byte_length = | |
| 109 | 109 | sizeof(*env->heap_statistics_buffer()) * kHeapStatisticsPropertiesCount; | |
@@ -149,7 +149,7 @@ void InitializeV8Bindings(Local<Object> target, | |||
| 149 | 149 | UpdateHeapSpaceStatisticsBuffer); | |
| 150 | 150 | ||
| 151 | 151 | env->set_heap_space_statistics_buffer( | |
| 152 | - new uint32_t[kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces]); | ||
| 152 | + new double[kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces]); | ||
| 153 | 153 | ||
| 154 | 154 | const size_t heap_space_statistics_buffer_byte_length = | |
| 155 | 155 | sizeof(*env->heap_space_statistics_buffer()) * | |
| Back | FazBrowse Home | New Git URL |
0 commit comments