Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: src/extensions/statistics-extension.cc

Issue 2490523003: [heap] Use size_t for heap and space counters. (Closed)
Patch Set: more fixes Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/heap/gc-tracer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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++) {
« no previous file with comments | « no previous file | src/heap/gc-tracer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698