Index: src/extensions/statistics-extension.cc |
diff --git a/src/extensions/statistics-extension.cc b/src/extensions/statistics-extension.cc |
index da533363af57bd62ce7b05f3b23df99fef1e980c..ad412975cf489e4b62eb68ed3cd73825e8a19cff 100644 |
--- a/src/extensions/statistics-extension.cc |
+++ b/src/extensions/statistics-extension.cc |
@@ -35,14 +35,14 @@ static void AddCounter(v8::Isolate* isolate, |
} |
} |
-static void AddNumber(v8::Isolate* isolate, |
- v8::Local<v8::Object> object, |
- intptr_t value, |
- const char* name) { |
- object->Set(isolate->GetCurrentContext(), |
- v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal) |
- .ToLocalChecked(), |
- v8::Number::New(isolate, static_cast<double>(value))).FromJust(); |
+static void AddNumber(v8::Isolate* isolate, v8::Local<v8::Object> object, |
+ double value, const char* name) { |
+ object |
+ ->Set(isolate->GetCurrentContext(), |
+ v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal) |
+ .ToLocalChecked(), |
+ v8::Number::New(isolate, value)) |
+ .FromJust(); |
} |
@@ -112,29 +112,24 @@ void StatisticsExtension::GetCounters( |
} |
struct StatisticNumber { |
- intptr_t number; |
+ size_t number; |
const char* name; |
}; |
const StatisticNumber numbers[] = { |
- {static_cast<intptr_t>(heap->memory_allocator()->Size()), |
- "total_committed_bytes"}, |
+ {heap->memory_allocator()->Size(), "total_committed_bytes"}, |
{heap->new_space()->Size(), "new_space_live_bytes"}, |
{heap->new_space()->Available(), "new_space_available_bytes"}, |
- {static_cast<intptr_t>(heap->new_space()->CommittedMemory()), |
- "new_space_commited_bytes"}, |
+ {heap->new_space()->CommittedMemory(), "new_space_commited_bytes"}, |
{heap->old_space()->Size(), "old_space_live_bytes"}, |
{heap->old_space()->Available(), "old_space_available_bytes"}, |
- {static_cast<intptr_t>(heap->old_space()->CommittedMemory()), |
- "old_space_commited_bytes"}, |
+ {heap->old_space()->CommittedMemory(), "old_space_commited_bytes"}, |
{heap->code_space()->Size(), "code_space_live_bytes"}, |
{heap->code_space()->Available(), "code_space_available_bytes"}, |
- {static_cast<intptr_t>(heap->code_space()->CommittedMemory()), |
- "code_space_commited_bytes"}, |
+ {heap->code_space()->CommittedMemory(), "code_space_commited_bytes"}, |
{heap->lo_space()->Size(), "lo_space_live_bytes"}, |
{heap->lo_space()->Available(), "lo_space_available_bytes"}, |
- {static_cast<intptr_t>(heap->lo_space()->CommittedMemory()), |
- "lo_space_commited_bytes"}, |
+ {heap->lo_space()->CommittedMemory(), "lo_space_commited_bytes"}, |
}; |
for (size_t i = 0; i < arraysize(numbers); i++) { |