Commit e25ac287 authored by rayb's avatar rayb Committed by Commit bot

S390: Change printf format specifier for size_t in heap.cc and spaces.cc

On S390, GCC seems to treat size_t as 'long_unsigned_int'. Which conflicts with the %d format specifier since that expects an 'int'. So changing the macro to PRIuS. This seems to fix the issue while retaining the expected behaviour for all other systems.

R=mlippautz@chromium.org, hpayer@chromium.org
BUG=none

Review-Url: https://codereview.chromium.org/2759963003
Cr-Commit-Position: refs/heads/master@{#43988}
parent 176a43fb
......@@ -4573,7 +4573,7 @@ void Heap::ReportHeapStatistics(const char* title) {
USE(title);
PrintF(">>>>>> =============== %s (%d) =============== >>>>>>\n", title,
gc_count_);
PrintF("old_generation_allocation_limit_ %" V8PRIdPTR "\n",
PrintF("old_generation_allocation_limit_ %" PRIuS "\n",
old_generation_allocation_limit_);
PrintF("\n");
......
......@@ -1037,7 +1037,7 @@ void MemoryAllocator::ZapBlock(Address start, size_t size) {
void MemoryAllocator::ReportStatistics() {
size_t size = Size();
float pct = static_cast<float>(capacity_ - size) / capacity_;
PrintF(" capacity: %zu , used: %" V8PRIdPTR ", available: %%%d\n\n",
PrintF(" capacity: %zu , used: %" PRIuS ", available: %%%d\n\n",
capacity_, size, static_cast<int>(pct * 100));
}
#endif
......@@ -2334,7 +2334,7 @@ void NewSpace::ReportStatistics() {
#ifdef DEBUG
if (FLAG_heap_stats) {
float pct = static_cast<float>(Available()) / TotalCapacity();
PrintF(" capacity: %" V8PRIdPTR ", available: %" V8PRIdPTR ", %%%d\n",
PrintF(" capacity: %" PRIuS ", available: %" PRIuS ", %%%d\n",
TotalCapacity(), Available(), static_cast<int>(pct * 100));
PrintF("\n Object Histogram:\n");
for (int i = 0; i <= LAST_TYPE; i++) {
......@@ -2918,8 +2918,8 @@ HeapObject* PagedSpace::SlowAllocateRaw(int size_in_bytes) {
#ifdef DEBUG
void PagedSpace::ReportStatistics() {
int pct = static_cast<int>(Available() * 100 / Capacity());
PrintF(" capacity: %" V8PRIdPTR ", waste: %" V8PRIdPTR
", available: %" V8PRIdPTR ", %%%d\n",
PrintF(" capacity: %" PRIuS ", waste: %" PRIuS
", available: %" PRIuS ", %%%d\n",
Capacity(), Waste(), Available(), pct);
heap()->mark_compact_collector()->EnsureSweepingCompleted();
......@@ -3260,7 +3260,7 @@ void LargeObjectSpace::Print() {
void LargeObjectSpace::ReportStatistics() {
PrintF(" size: %" V8PRIdPTR "\n", size_);
PrintF(" size: %" PRIuS "\n", size_);
int num_objects = 0;
ClearHistograms(heap()->isolate());
LargeObjectIterator it(this);
......@@ -3271,7 +3271,7 @@ void LargeObjectSpace::ReportStatistics() {
PrintF(
" number of objects %d, "
"size of objects %" V8PRIdPTR "\n",
"size of objects %" PRIuS "\n",
num_objects, objects_size_);
if (num_objects > 0) ReportHistogram(heap()->isolate(), false);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment