| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 69b55f3 commit a3ad63b
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; | |
@@ -28,7 +28,7 @@ const kHeapSizeLimitIndex = v8binding.kHeapSizeLimitIndex; | |||
| 28 | 28 | ||
| 29 | 29 | // Properties for heap space statistics buffer extraction. | |
| 30 | 30 | const heapSpaceStatisticsBuffer = | |
| 31 | - new Uint32Array(v8binding.heapSpaceStatisticsArrayBuffer); | ||
| 31 | + new Float64Array(v8binding.heapSpaceStatisticsArrayBuffer); | ||
| 32 | 32 | const kHeapSpaces = v8binding.kHeapSpaces; | |
| 33 | 33 | const kNumberOfHeapSpaces = kHeapSpaces.length; | |
| 34 | 34 | const kHeapSpaceStatisticsPropertiesCount = | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -396,22 +396,22 @@ inline std::vector<int64_t>* Environment::destroy_ids_list() { | |||
| 396 | 396 | return &destroy_ids_list_; | |
| 397 | 397 | } | |
| 398 | 398 | ||
| 399 | - inline uint32_t* Environment::heap_statistics_buffer() const { | ||
| 399 | + inline double* Environment::heap_statistics_buffer() const { | ||
| 400 | 400 | CHECK_NE(heap_statistics_buffer_, nullptr); | |
| 401 | 401 | return heap_statistics_buffer_; | |
| 402 | 402 | } | |
| 403 | 403 | ||
| 404 | - inline void Environment::set_heap_statistics_buffer(uint32_t* pointer) { | ||
| 404 | + inline void Environment::set_heap_statistics_buffer(double* pointer) { | ||
| 405 | 405 | CHECK_EQ(heap_statistics_buffer_, nullptr); // Should be set only once. | |
| 406 | 406 | heap_statistics_buffer_ = pointer; | |
| 407 | 407 | } | |
| 408 | 408 | ||
| 409 | - inline uint32_t* Environment::heap_space_statistics_buffer() const { | ||
| 409 | + inline double* Environment::heap_space_statistics_buffer() const { | ||
| 410 | 410 | CHECK_NE(heap_space_statistics_buffer_, nullptr); | |
| 411 | 411 | return heap_space_statistics_buffer_; | |
| 412 | 412 | } | |
| 413 | 413 | ||
| 414 | - inline void Environment::set_heap_space_statistics_buffer(uint32_t* pointer) { | ||
| 414 | + inline void Environment::set_heap_space_statistics_buffer(double* pointer) { | ||
| 415 | 415 | CHECK_EQ(heap_space_statistics_buffer_, nullptr); // Should be set only once. | |
| 416 | 416 | heap_space_statistics_buffer_ = pointer; | |
| 417 | 417 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -458,11 +458,11 @@ class Environment { | |||
| 458 | 458 | // List of id's that have been destroyed and need the destroy() cb called. | |
| 459 | 459 | inline std::vector<int64_t>* destroy_ids_list(); | |
| 460 | 460 | ||
| 461 | - inline uint32_t* heap_statistics_buffer() const; | ||
| 462 | - inline void set_heap_statistics_buffer(uint32_t* pointer); | ||
| 461 | + inline double* heap_statistics_buffer() const; | ||
| 462 | + inline void set_heap_statistics_buffer(double* pointer); | ||
| 463 | 463 | ||
| 464 | - inline uint32_t* heap_space_statistics_buffer() const; | ||
| 465 | - inline void set_heap_space_statistics_buffer(uint32_t* pointer); | ||
| 464 | + inline double* heap_space_statistics_buffer() const; | ||
| 465 | + inline void set_heap_space_statistics_buffer(double* pointer); | ||
| 466 | 466 | ||
| 467 | 467 | inline char* http_parser_buffer() const; | |
| 468 | 468 | inline void set_http_parser_buffer(char* buffer); | |
@@ -578,8 +578,8 @@ class Environment { | |||
| 578 | 578 | &HandleCleanup::handle_cleanup_queue_> handle_cleanup_queue_; | |
| 579 | 579 | int handle_cleanup_waiting_; | |
| 580 | 580 | ||
| 581 | - uint32_t* heap_statistics_buffer_ = nullptr; | ||
| 582 | - uint32_t* heap_space_statistics_buffer_ = nullptr; | ||
| 581 | + double* heap_statistics_buffer_ = nullptr; | ||
| 582 | + double* heap_space_statistics_buffer_ = nullptr; | ||
| 583 | 583 | ||
| 584 | 584 | char* http_parser_buffer_; | |
| 585 | 585 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,8 +54,8 @@ void UpdateHeapStatisticsArrayBuffer(const FunctionCallbackInfo<Value>& args) { | |||
| 54 | 54 | Environment* env = Environment::GetCurrent(args); | |
| 55 | 55 | HeapStatistics s; | |
| 56 | 56 | env->isolate()->GetHeapStatistics(&s); | |
| 57 | - uint32_t* const buffer = env->heap_statistics_buffer(); | ||
| 58 | - #define V(index, name, _) buffer[index] = static_cast<uint32_t>(s.name()); | ||
| 57 | + double* const buffer = env->heap_statistics_buffer(); | ||
| 58 | + #define V(index, name, _) buffer[index] = static_cast<double>(s.name()); | ||
| 59 | 59 | HEAP_STATISTICS_PROPERTIES(V) | |
| 60 | 60 | #undef V | |
| 61 | 61 | } | |
@@ -65,13 +65,13 @@ void UpdateHeapSpaceStatisticsBuffer(const FunctionCallbackInfo<Value>& args) { | |||
| 65 | 65 | Environment* env = Environment::GetCurrent(args); | |
| 66 | 66 | HeapSpaceStatistics s; | |
| 67 | 67 | Isolate* const isolate = env->isolate(); | |
| 68 | - uint32_t* buffer = env->heap_space_statistics_buffer(); | ||
| 68 | + double* buffer = env->heap_space_statistics_buffer(); | ||
| 69 | 69 | ||
| 70 | 70 | for (size_t i = 0; i < number_of_heap_spaces; i++) { | |
| 71 | 71 | isolate->GetHeapSpaceStatistics(&s, i); | |
| 72 | 72 | size_t const property_offset = i * kHeapSpaceStatisticsPropertiesCount; | |
| 73 | 73 | #define V(index, name, _) buffer[property_offset + index] = \ | |
| 74 | - static_cast<uint32_t>(s.name()); | ||
| 74 | + static_cast<double>(s.name()); | ||
| 75 | 75 | HEAP_SPACE_STATISTICS_PROPERTIES(V) | |
| 76 | 76 | #undef V | |
| 77 | 77 | } | |
@@ -100,7 +100,7 @@ void InitializeV8Bindings(Local<Object> target, | |||
| 100 | 100 | "updateHeapStatisticsArrayBuffer", | |
| 101 | 101 | UpdateHeapStatisticsArrayBuffer); | |
| 102 | 102 | ||
| 103 | - env->set_heap_statistics_buffer(new uint32_t[kHeapStatisticsPropertiesCount]); | ||
| 103 | + env->set_heap_statistics_buffer(new double[kHeapStatisticsPropertiesCount]); | ||
| 104 | 104 | ||
| 105 | 105 | const size_t heap_statistics_buffer_byte_length = | |
| 106 | 106 | sizeof(*env->heap_statistics_buffer()) * kHeapStatisticsPropertiesCount; | |
@@ -146,7 +146,7 @@ void InitializeV8Bindings(Local<Object> target, | |||
| 146 | 146 | UpdateHeapSpaceStatisticsBuffer); | |
| 147 | 147 | ||
| 148 | 148 | env->set_heap_space_statistics_buffer( | |
| 149 | - new uint32_t[kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces]); | ||
| 149 | + new double[kHeapSpaceStatisticsPropertiesCount * number_of_heap_spaces]); | ||
| 150 | 150 | ||
| 151 | 151 | const size_t heap_space_statistics_buffer_byte_length = | |
| 152 | 152 | sizeof(*env->heap_space_statistics_buffer()) * | |
| Back | FazBrowse Home | New Git URL |
0 commit comments