diff options
author | chappedm@gmail.com <chappedm@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50> | 2012-11-03 15:56:27 +0000 |
---|---|---|
committer | chappedm@gmail.com <chappedm@gmail.com@6b5cf1ce-ec42-a296-1ba9-69fdba395a50> | 2012-11-03 15:56:27 +0000 |
commit | 6287bbbbad8730712cfd1ee28ecc0648cbaa9f94 (patch) | |
tree | dc57a737fe4e5fc6ef36e4291e0a789dd9179114 | |
parent | 87699c97cc07b30fc2765415853ae685f7bc45f2 (diff) | |
download | gperftools-6287bbbbad8730712cfd1ee28ecc0648cbaa9f94.tar.gz |
issue-477: Fix clang compilation errors regarding format specifiers
git-svn-id: http://gperftools.googlecode.com/svn/trunk@170 6b5cf1ce-ec42-a296-1ba9-69fdba395a50
-rw-r--r-- | src/base/sysinfo.cc | 6 | ||||
-rw-r--r-- | src/debugallocation.cc | 8 | ||||
-rw-r--r-- | src/getpc.h | 2 | ||||
-rw-r--r-- | src/heap-checker.cc | 46 | ||||
-rw-r--r-- | src/heap-profile-table.cc | 10 | ||||
-rw-r--r-- | src/heap-profiler.cc | 24 | ||||
-rw-r--r-- | src/malloc_extension.cc | 2 | ||||
-rw-r--r-- | src/memory_region_map.cc | 22 | ||||
-rw-r--r-- | src/symbolize.cc | 2 | ||||
-rw-r--r-- | src/tcmalloc.cc | 2 | ||||
-rw-r--r-- | src/tests/markidle_unittest.cc | 6 | ||||
-rw-r--r-- | src/tests/tcmalloc_unittest.cc | 2 |
12 files changed, 66 insertions, 66 deletions
diff --git a/src/base/sysinfo.cc b/src/base/sysinfo.cc index 841ee76..9790c36 100644 --- a/src/base/sysinfo.cc +++ b/src/base/sysinfo.cc @@ -907,7 +907,7 @@ bool ProcMapsIterator::NextExt(uint64 *start, uint64 *end, char **flags, // start end resident privateresident obj(?) prot refcnt shadowcnt // flags copy_on_write needs_copy type filename: // 0x8048000 0x804a000 2 0 0xc104ce70 r-x 1 0 0x0 COW NC vnode /bin/cat - if (sscanf(stext_, "0x%"SCNx64" 0x%"SCNx64" %*d %*d %*p %3s %*d %*d 0x%*x %*s %*s %*s %n", + if (sscanf(stext_, "0x%" SCNx64 " 0x%" SCNx64 " %*d %*d %*p %3s %*d %*d 0x%*x %*s %*s %*s %n", start ? start : &tmpstart, end ? end : &tmpend, flags_, @@ -944,7 +944,7 @@ bool ProcMapsIterator::NextExt(uint64 *start, uint64 *end, char **flags, uint64 tmp_anon_mapping; uint64 tmp_anon_pages; - sscanf(backing_ptr+1, "F %"SCNx64" %"SCNd64") (A %"SCNx64" %"SCNd64")", + sscanf(backing_ptr+1, "F %" SCNx64 " %" SCNd64 ") (A %" SCNx64 " %" SCNd64 ")", file_mapping ? file_mapping : &tmp_file_mapping, file_pages ? file_pages : &tmp_file_pages, anon_mapping ? anon_mapping : &tmp_anon_mapping, @@ -1084,7 +1084,7 @@ int ProcMapsIterator::FormatLine(char* buffer, int bufsize, ? '-' : 'p'; const int rc = snprintf(buffer, bufsize, - "%08"PRIx64"-%08"PRIx64" %c%c%c%c %08"PRIx64" %02x:%02x %-11"PRId64" %s\n", + "%08" PRIx64 "-%08" PRIx64 " %c%c%c%c %08" PRIx64 " %02x:%02x %-11" PRId64 " %s\n", start, end, r,w,x,p, offset, static_cast<int>(dev/256), static_cast<int>(dev%256), inode, filename); diff --git a/src/debugallocation.cc b/src/debugallocation.cc index 70ec162..21961d6 100644 --- a/src/debugallocation.cc +++ b/src/debugallocation.cc @@ -488,7 +488,7 @@ class MallocBlock { // the address space could take more. static size_t max_size_t = ~0; if (size > max_size_t - sizeof(MallocBlock)) { - RAW_LOG(ERROR, "Massive size passed to malloc: %"PRIuS"", size); + RAW_LOG(ERROR, "Massive size passed to malloc: %" PRIuS "", size); return NULL; } MallocBlock* b = NULL; @@ -958,7 +958,7 @@ static SpinLock malloc_trace_lock(SpinLock::LINKER_INITIALIZED); do { \ if (FLAGS_malloctrace) { \ SpinLockHolder l(&malloc_trace_lock); \ - TracePrintf(TraceFd(), "%s\t%"PRIuS"\t%p\t%"GPRIuPTHREAD, \ + TracePrintf(TraceFd(), "%s\t%" PRIuS "\t%p\t%" GPRIuPTHREAD, \ name, size, addr, PRINTABLE_PTHREAD(pthread_self())); \ TraceStack(); \ TracePrintf(TraceFd(), "\n"); \ @@ -1215,7 +1215,7 @@ extern "C" PERFTOOLS_DLL_DECL void* tc_new(size_t size) { void* ptr = debug_cpp_alloc(size, MallocBlock::kNewType, false); MallocHook::InvokeNewHook(ptr, size); if (ptr == NULL) { - RAW_LOG(FATAL, "Unable to allocate %"PRIuS" bytes: new failed.", size); + RAW_LOG(FATAL, "Unable to allocate %" PRIuS " bytes: new failed.", size); } return ptr; } @@ -1242,7 +1242,7 @@ extern "C" PERFTOOLS_DLL_DECL void* tc_newarray(size_t size) { void* ptr = debug_cpp_alloc(size, MallocBlock::kArrayNewType, false); MallocHook::InvokeNewHook(ptr, size); if (ptr == NULL) { - RAW_LOG(FATAL, "Unable to allocate %"PRIuS" bytes: new[] failed.", size); + RAW_LOG(FATAL, "Unable to allocate %" PRIuS " bytes: new[] failed.", size); } return ptr; } diff --git a/src/getpc.h b/src/getpc.h index 9fb2e16..87eab73 100644 --- a/src/getpc.h +++ b/src/getpc.h @@ -94,7 +94,7 @@ struct CallUnrollInfo { int pc_offset; // The actual instruction bytes. Feel free to make it larger if you // need a longer sequence. - char ins[16]; + unsigned char ins[16]; // How many bytes to match from ins array? int ins_size; // The offset from the stack pointer (e)sp where to look for the diff --git a/src/heap-checker.cc b/src/heap-checker.cc index 88d88f9..bc9e490 100644 --- a/src/heap-checker.cc +++ b/src/heap-checker.cc @@ -567,7 +567,7 @@ static void NewHook(const void* ptr, size_t size) { if (ptr != NULL) { const int counter = get_thread_disable_counter(); const bool ignore = (counter > 0); - RAW_VLOG(16, "Recording Alloc: %p of %"PRIuS "; %d", ptr, size, + RAW_VLOG(16, "Recording Alloc: %p of %" PRIuS "; %d", ptr, size, int(counter)); // Fetch the caller's stack trace before acquiring heap_checker_lock. @@ -587,7 +587,7 @@ static void NewHook(const void* ptr, size_t size) { } } } - RAW_VLOG(17, "Alloc Recorded: %p of %"PRIuS"", ptr, size); + RAW_VLOG(17, "Alloc Recorded: %p of %" PRIuS "", ptr, size); } } @@ -645,12 +645,12 @@ static void RegisterStackLocked(const void* top_ptr) { if (MemoryRegionMap::FindAndMarkStackRegion(top, ®ion)) { // Make the proper portion of the stack live: if (stack_direction == GROWS_TOWARDS_LOW_ADDRESSES) { - RAW_VLOG(11, "Live stack at %p of %"PRIuPTR" bytes", + RAW_VLOG(11, "Live stack at %p of %" PRIuPTR " bytes", top_ptr, region.end_addr - top); live_objects->push_back(AllocObject(top_ptr, region.end_addr - top, THREAD_DATA)); } else { // GROWS_TOWARDS_HIGH_ADDRESSES - RAW_VLOG(11, "Live stack at %p of %"PRIuPTR" bytes", + RAW_VLOG(11, "Live stack at %p of %" PRIuPTR " bytes", AsPtr(region.start_addr), top - region.start_addr); live_objects->push_back(AllocObject(AsPtr(region.start_addr), @@ -692,12 +692,12 @@ static void RegisterStackLocked(const void* top_ptr) { } // Make the proper portion of the stack live: if (stack_direction == GROWS_TOWARDS_LOW_ADDRESSES) { - RAW_VLOG(11, "Live stack at %p of %"PRIuPTR" bytes", + RAW_VLOG(11, "Live stack at %p of %" PRIuPTR " bytes", top_ptr, stack_end - top); live_objects->push_back( AllocObject(top_ptr, stack_end - top, THREAD_DATA)); } else { // GROWS_TOWARDS_HIGH_ADDRESSES - RAW_VLOG(11, "Live stack at %p of %"PRIuPTR" bytes", + RAW_VLOG(11, "Live stack at %p of %" PRIuPTR " bytes", AsPtr(stack_start), top - stack_start); live_objects->push_back( AllocObject(AsPtr(stack_start), top - stack_start, THREAD_DATA)); @@ -770,14 +770,14 @@ static void MakeDisabledLiveCallbackLocked( // and the rest of the region where the stack lives can well // contain outdated stack variables which are not live anymore, // hence should not be treated as such. - RAW_VLOG(11, "Not %s-disabling %"PRIuS" bytes at %p" + RAW_VLOG(11, "Not %s-disabling %" PRIuS " bytes at %p" ": have stack inside: %p", (stack_disable ? "stack" : "range"), info.object_size, ptr, AsPtr(*iter)); return; } } - RAW_VLOG(11, "%s-disabling %"PRIuS" bytes at %p", + RAW_VLOG(11, "%s-disabling %" PRIuS " bytes at %p", (stack_disable ? "Stack" : "Range"), info.object_size, ptr); live_objects->push_back(AllocObject(ptr, info.object_size, MUST_BE_ON_HEAP)); @@ -1061,7 +1061,7 @@ static enum { if (thread_registers.size()) { // Make thread registers be live heap data sources. // we rely here on the fact that vector is in one memory chunk: - RAW_VLOG(11, "Live registers at %p of %"PRIuS" bytes", + RAW_VLOG(11, "Live registers at %p of %" PRIuS " bytes", &thread_registers[0], thread_registers.size() * sizeof(void*)); live_objects->push_back(AllocObject(&thread_registers[0], thread_registers.size() * sizeof(void*), @@ -1098,7 +1098,7 @@ void HeapLeakChecker::IgnoreNonThreadLiveObjectsLocked() { for (IgnoredObjectsMap::const_iterator object = ignored_objects->begin(); object != ignored_objects->end(); ++object) { const void* ptr = AsPtr(object->first); - RAW_VLOG(11, "Ignored live object at %p of %"PRIuS" bytes", + RAW_VLOG(11, "Ignored live object at %p of %" PRIuS " bytes", ptr, object->second); live_objects-> push_back(AllocObject(ptr, object->second, MUST_BE_ON_HEAP)); @@ -1107,7 +1107,7 @@ void HeapLeakChecker::IgnoreNonThreadLiveObjectsLocked() { size_t object_size; if (!(heap_profile->FindAlloc(ptr, &object_size) && object->second == object_size)) { - RAW_LOG(FATAL, "Object at %p of %"PRIuS" bytes from an" + RAW_LOG(FATAL, "Object at %p of %" PRIuS " bytes from an" " IgnoreObject() has disappeared", ptr, object->second); } } @@ -1214,7 +1214,7 @@ void HeapLeakChecker::IgnoreNonThreadLiveObjectsLocked() { if (VLOG_IS_ON(11)) { for (LiveObjectsStack::const_iterator i = l->second.begin(); i != l->second.end(); ++i) { - RAW_VLOG(11, "Library live region at %p of %"PRIuPTR" bytes", + RAW_VLOG(11, "Library live region at %p of %" PRIuPTR " bytes", i->ptr, i->size); } } @@ -1335,7 +1335,7 @@ void HeapLeakChecker::IgnoreAllLiveObjectsLocked(const void* self_stack_top) { IgnoreNonThreadLiveObjectsLocked(); } if (live_objects_total) { - RAW_VLOG(10, "Ignoring %"PRId64" reachable objects of %"PRId64" bytes", + RAW_VLOG(10, "Ignoring %" PRId64 " reachable objects of %" PRId64 " bytes", live_objects_total, live_bytes_total); } // Free these: we made them here and heap_profile never saw them @@ -1394,7 +1394,7 @@ static SpinLock alignment_checker_lock(SpinLock::LINKER_INITIALIZED); live_object_count += 1; live_byte_count += size; } - RAW_VLOG(13, "Looking for heap pointers in %p of %"PRIuS" bytes", + RAW_VLOG(13, "Looking for heap pointers in %p of %" PRIuS " bytes", object, size); const char* const whole_object = object; size_t const whole_size = size; @@ -1465,8 +1465,8 @@ static SpinLock alignment_checker_lock(SpinLock::LINKER_INITIALIZED); // a heap object which is in fact leaked. // I.e. in very rare and probably not repeatable/lasting cases // we might miss some real heap memory leaks. - RAW_VLOG(14, "Found pointer to %p of %"PRIuS" bytes at %p " - "inside %p of size %"PRIuS"", + RAW_VLOG(14, "Found pointer to %p of %" PRIuS " bytes at %p " + "inside %p of size %" PRIuS "", ptr, object_size, object, whole_object, whole_size); if (VLOG_IS_ON(15)) { // log call stacks to help debug how come something is not a leak @@ -1491,7 +1491,7 @@ static SpinLock alignment_checker_lock(SpinLock::LINKER_INITIALIZED); live_objects_total += live_object_count; live_bytes_total += live_byte_count; if (live_object_count) { - RAW_VLOG(10, "Removed %"PRId64" live heap objects of %"PRId64" bytes: %s%s", + RAW_VLOG(10, "Removed %" PRId64 " live heap objects of %" PRId64 " bytes: %s%s", live_object_count, live_byte_count, name, name2); } } @@ -1513,7 +1513,7 @@ void HeapLeakChecker::DoIgnoreObject(const void* ptr) { if (!HaveOnHeapLocked(&ptr, &object_size)) { RAW_LOG(ERROR, "No live heap object at %p to ignore", ptr); } else { - RAW_VLOG(10, "Going to ignore live object at %p of %"PRIuS" bytes", + RAW_VLOG(10, "Going to ignore live object at %p of %" PRIuS " bytes", ptr, object_size); if (ignored_objects == NULL) { ignored_objects = new(Allocator::Allocate(sizeof(IgnoredObjectsMap))) @@ -1540,7 +1540,7 @@ void HeapLeakChecker::UnIgnoreObject(const void* ptr) { ignored_objects->erase(object); found = true; RAW_VLOG(10, "Now not going to ignore live object " - "at %p of %"PRIuS" bytes", ptr, object_size); + "at %p of %" PRIuS " bytes", ptr, object_size); } } if (!found) RAW_LOG(FATAL, "Object at %p has not been ignored", ptr); @@ -1588,8 +1588,8 @@ void HeapLeakChecker::Create(const char *name, bool make_start_snapshot) { const HeapProfileTable::Stats& t = heap_profile->total(); const size_t start_inuse_bytes = t.alloc_size - t.free_size; const size_t start_inuse_allocs = t.allocs - t.frees; - RAW_VLOG(10, "Start check \"%s\" profile: %"PRIuS" bytes " - "in %"PRIuS" objects", + RAW_VLOG(10, "Start check \"%s\" profile: %" PRIuS " bytes " + "in %" PRIuS " objects", name_, start_inuse_bytes, start_inuse_allocs); } else { RAW_LOG(WARNING, "Heap checker is not active, " @@ -1813,7 +1813,7 @@ bool HeapLeakChecker::DoNoLeaks(ShouldSymbolize should_symbolize) { RAW_VLOG(heap_checker_info_level, "No leaks found for check \"%s\" " "(but no 100%% guarantee that there aren't any): " - "found %"PRId64" reachable heap objects of %"PRId64" bytes", + "found %" PRId64 " reachable heap objects of %" PRId64 " bytes", name_, int64(stats.allocs - stats.frees), int64(stats.alloc_size - stats.free_size)); @@ -2353,7 +2353,7 @@ inline bool HeapLeakChecker::HaveOnHeapLocked(const void** ptr, const uintptr_t addr = AsInt(*ptr); if (heap_profile->FindInsideAlloc( *ptr, max_heap_object_size, ptr, object_size)) { - RAW_VLOG(16, "Got pointer into %p at +%"PRIuPTR" offset", + RAW_VLOG(16, "Got pointer into %p at +%" PRIuPTR " offset", *ptr, addr - AsInt(*ptr)); return true; } diff --git a/src/heap-profile-table.cc b/src/heap-profile-table.cc index 8b2ed33..6db2caa 100644 --- a/src/heap-profile-table.cc +++ b/src/heap-profile-table.cc @@ -303,7 +303,7 @@ int HeapProfileTable::UnparseBucket(const Bucket& b, profile_stats->free_size += b.free_size; } int printed = - snprintf(buf + buflen, bufsize - buflen, "%6d: %8"PRId64" [%6d: %8"PRId64"] @%s", + snprintf(buf + buflen, bufsize - buflen, "%6d: %8" PRId64 " [%6d: %8" PRId64 "] @%s", b.allocs - b.frees, b.alloc_size - b.free_size, b.allocs, @@ -616,8 +616,8 @@ void HeapProfileTable::Snapshot::ReportLeaks(const char* checker_name, // This is only used by the heap leak checker, but is intimately // tied to the allocation map that belongs in this module and is // therefore placed here. - RAW_LOG(ERROR, "Leak check %s detected leaks of %"PRIuS" bytes " - "in %"PRIuS" objects", + RAW_LOG(ERROR, "Leak check %s detected leaks of %" PRIuS " bytes " + "in %" PRIuS " objects", checker_name, size_t(total_.alloc_size), size_t(total_.allocs)); @@ -663,7 +663,7 @@ void HeapProfileTable::Snapshot::ReportLeaks(const char* checker_name, e.bytes, e.count); for (int j = 0; j < e.bucket->depth; j++) { const void* pc = e.bucket->stack[j]; - printer.Printf("\t@ %"PRIxPTR" %s\n", + printer.Printf("\t@ %" PRIxPTR " %s\n", reinterpret_cast<uintptr_t>(pc), symbolization_table.GetSymbol(pc)); } RAW_LOG(ERROR, "%s", buffer); @@ -687,7 +687,7 @@ void HeapProfileTable::Snapshot::ReportObject(const void* ptr, char* unused) { // Perhaps also log the allocation stack trace (unsymbolized) // on this line in case somebody finds it useful. - RAW_LOG(ERROR, "leaked %"PRIuS" byte object %p", v->bytes, ptr); + RAW_LOG(ERROR, "leaked %" PRIuS " byte object %p", v->bytes, ptr); } void HeapProfileTable::Snapshot::ReportIndividualObjects() { diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc index eae2e08..532d0f2 100644 --- a/src/heap-profiler.cc +++ b/src/heap-profiler.cc @@ -273,21 +273,21 @@ static void MaybeDumpProfileLocked() { if (FLAGS_heap_profile_allocation_interval > 0 && total.alloc_size >= last_dump_alloc + FLAGS_heap_profile_allocation_interval) { - snprintf(buf, sizeof(buf), ("%"PRId64" MB allocated cumulatively, " - "%"PRId64" MB currently in use"), + snprintf(buf, sizeof(buf), ("%" PRId64 " MB allocated cumulatively, " + "%" PRId64 " MB currently in use"), total.alloc_size >> 20, inuse_bytes >> 20); need_to_dump = true; } else if (FLAGS_heap_profile_deallocation_interval > 0 && total.free_size >= last_dump_free + FLAGS_heap_profile_deallocation_interval) { - snprintf(buf, sizeof(buf), ("%"PRId64" MB freed cumulatively, " - "%"PRId64" MB currently in use"), + snprintf(buf, sizeof(buf), ("%" PRId64 " MB freed cumulatively, " + "%" PRId64 " MB currently in use"), total.free_size >> 20, inuse_bytes >> 20); need_to_dump = true; } else if (FLAGS_heap_profile_inuse_interval > 0 && inuse_bytes > high_water_mark + FLAGS_heap_profile_inuse_interval) { - snprintf(buf, sizeof(buf), "%"PRId64" MB currently in use", + snprintf(buf, sizeof(buf), "%" PRId64 " MB currently in use", inuse_bytes >> 20); need_to_dump = true; } else if (FLAGS_heap_profile_time_interval > 0 && @@ -359,8 +359,8 @@ static void MmapHook(const void* result, const void* start, size_t size, // in pretty-printing of NULL as "nil". // TODO(maxim): instead should use a safe snprintf reimplementation RAW_LOG(INFO, - "mmap(start=0x%"PRIxPTR", len=%"PRIuS", prot=0x%x, flags=0x%x, " - "fd=%d, offset=0x%x) = 0x%"PRIxPTR"", + "mmap(start=0x%" PRIxPTR ", len=%" PRIuS ", prot=0x%x, flags=0x%x, " + "fd=%d, offset=0x%x) = 0x%" PRIxPTR "", (uintptr_t) start, size, prot, flags, fd, (unsigned int) offset, (uintptr_t) result); #ifdef TODO_REENABLE_STACK_TRACING @@ -377,9 +377,9 @@ static void MremapHook(const void* result, const void* old_addr, // in pretty-printing of NULL as "nil". // TODO(maxim): instead should use a safe snprintf reimplementation RAW_LOG(INFO, - "mremap(old_addr=0x%"PRIxPTR", old_size=%"PRIuS", " - "new_size=%"PRIuS", flags=0x%x, new_addr=0x%"PRIxPTR") = " - "0x%"PRIxPTR"", + "mremap(old_addr=0x%" PRIxPTR ", old_size=%" PRIuS ", " + "new_size=%" PRIuS ", flags=0x%x, new_addr=0x%" PRIxPTR ") = " + "0x%" PRIxPTR "", (uintptr_t) old_addr, old_size, new_size, flags, (uintptr_t) new_addr, (uintptr_t) result); #ifdef TODO_REENABLE_STACK_TRACING @@ -393,7 +393,7 @@ static void MunmapHook(const void* ptr, size_t size) { // We use PRIxS not just '%p' to avoid deadlocks // in pretty-printing of NULL as "nil". // TODO(maxim): instead should use a safe snprintf reimplementation - RAW_LOG(INFO, "munmap(start=0x%"PRIxPTR", len=%"PRIuS")", + RAW_LOG(INFO, "munmap(start=0x%" PRIxPTR ", len=%" PRIuS ")", (uintptr_t) ptr, size); #ifdef TODO_REENABLE_STACK_TRACING DumpStackTrace(1, RawInfoStackDumper, NULL); @@ -403,7 +403,7 @@ static void MunmapHook(const void* ptr, size_t size) { static void SbrkHook(const void* result, ptrdiff_t increment) { if (FLAGS_mmap_log) { // log it - RAW_LOG(INFO, "sbrk(inc=%"PRIdS") = 0x%"PRIxPTR"", + RAW_LOG(INFO, "sbrk(inc=%" PRIdS ") = 0x%" PRIxPTR "", increment, (uintptr_t) result); #ifdef TODO_REENABLE_STACK_TRACING DumpStackTrace(1, RawInfoStackDumper, NULL); diff --git a/src/malloc_extension.cc b/src/malloc_extension.cc index 2d6497f..d541fad 100644 --- a/src/malloc_extension.cc +++ b/src/malloc_extension.cc @@ -244,7 +244,7 @@ void PrintCountAndSize(MallocExtensionWriter* writer, uintptr_t count, uintptr_t size) { char buf[100]; snprintf(buf, sizeof(buf), - "%6"PRIu64": %8"PRIu64" [%6"PRIu64": %8"PRIu64"] @", + "%6" PRIu64 ": %8" PRIu64 " [%6" PRIu64 ": %8" PRIu64 "] @", static_cast<uint64>(count), static_cast<uint64>(size), static_cast<uint64>(count), diff --git a/src/memory_region_map.cc b/src/memory_region_map.cc index 1a81172..0ce97c2 100644 --- a/src/memory_region_map.cc +++ b/src/memory_region_map.cc @@ -512,7 +512,7 @@ void MemoryRegionMap::RecordRegionRemoval(const void* start, size_t size) { uintptr_t start_addr = reinterpret_cast<uintptr_t>(start); uintptr_t end_addr = start_addr + size; // subtract start_addr, end_addr from all the regions - RAW_VLOG(10, "Removing global region %p..%p; have %"PRIuS" regions", + RAW_VLOG(10, "Removing global region %p..%p; have %" PRIuS " regions", reinterpret_cast<void*>(start_addr), reinterpret_cast<void*>(end_addr), regions_->size()); @@ -571,7 +571,7 @@ void MemoryRegionMap::RecordRegionRemoval(const void* start, size_t size) { } ++region; } - RAW_VLOG(12, "Removed region %p..%p; have %"PRIuS" regions", + RAW_VLOG(12, "Removed region %p..%p; have %" PRIuS " regions", reinterpret_cast<void*>(start_addr), reinterpret_cast<void*>(end_addr), regions_->size()); @@ -584,10 +584,10 @@ void MemoryRegionMap::MmapHook(const void* result, const void* start, size_t size, int prot, int flags, int fd, off_t offset) { - // TODO(maxim): replace all 0x%"PRIxS" by %p when RAW_VLOG uses a safe + // TODO(maxim): replace all 0x%" PRIxS " by %p when RAW_VLOG uses a safe // snprintf reimplementation that does not malloc to pretty-print NULL - RAW_VLOG(10, "MMap = 0x%"PRIxPTR" of %"PRIuS" at %"PRIu64" " - "prot %d flags %d fd %d offs %"PRId64, + RAW_VLOG(10, "MMap = 0x%" PRIxPTR " of %" PRIuS " at %" PRIu64 " " + "prot %d flags %d fd %d offs %" PRId64, reinterpret_cast<uintptr_t>(result), size, reinterpret_cast<uint64>(start), prot, flags, fd, static_cast<int64>(offset)); @@ -597,7 +597,7 @@ void MemoryRegionMap::MmapHook(const void* result, } void MemoryRegionMap::MunmapHook(const void* ptr, size_t size) { - RAW_VLOG(10, "MUnmap of %p %"PRIuS"", ptr, size); + RAW_VLOG(10, "MUnmap of %p %" PRIuS "", ptr, size); if (size != 0) { RecordRegionRemoval(ptr, size); } @@ -607,8 +607,8 @@ void MemoryRegionMap::MremapHook(const void* result, const void* old_addr, size_t old_size, size_t new_size, int flags, const void* new_addr) { - RAW_VLOG(10, "MRemap = 0x%"PRIxPTR" of 0x%"PRIxPTR" %"PRIuS" " - "to %"PRIuS" flags %d new_addr=0x%"PRIxPTR, + RAW_VLOG(10, "MRemap = 0x%" PRIxPTR " of 0x%" PRIxPTR " %" PRIuS " " + "to %" PRIuS " flags %d new_addr=0x%" PRIxPTR, (uintptr_t)result, (uintptr_t)old_addr, old_size, new_size, flags, flags & MREMAP_FIXED ? (uintptr_t)new_addr : 0); @@ -621,7 +621,7 @@ void MemoryRegionMap::MremapHook(const void* result, extern "C" void* __sbrk(ptrdiff_t increment); // defined in libc void MemoryRegionMap::SbrkHook(const void* result, ptrdiff_t increment) { - RAW_VLOG(10, "Sbrk = 0x%"PRIxPTR" of %"PRIdS"", (uintptr_t)result, increment); + RAW_VLOG(10, "Sbrk = 0x%" PRIxPTR " of %" PRIdS "", (uintptr_t)result, increment); if (result != reinterpret_cast<void*>(-1)) { if (increment > 0) { void* new_end = sbrk(0); @@ -641,8 +641,8 @@ void MemoryRegionMap::LogAllLocked() { uintptr_t previous = 0; for (RegionSet::const_iterator r = regions_->begin(); r != regions_->end(); ++r) { - RAW_LOG(INFO, "Memory region 0x%"PRIxPTR"..0x%"PRIxPTR" " - "from 0x%"PRIxPTR" stack=%d", + RAW_LOG(INFO, "Memory region 0x%" PRIxPTR "..0x%" PRIxPTR " " + "from 0x%" PRIxPTR " stack=%d", r->start_addr, r->end_addr, r->caller(), r->is_stack); RAW_CHECK(previous < r->end_addr, "wow, we messed up the set order"); // this must be caused by uncontrolled recursive operations on regions_ diff --git a/src/symbolize.cc b/src/symbolize.cc index d90c4b8..65150f3 100644 --- a/src/symbolize.cc +++ b/src/symbolize.cc @@ -229,7 +229,7 @@ int SymbolTable::Symbolize() { iter != symbolization_table_.end(); ++iter) { written += snprintf(pprof_buffer + written, kOutBufSize - written, // pprof expects format to be 0xXXXXXX - "0x%"PRIxPTR"\n", reinterpret_cast<uintptr_t>(iter->first)); + "0x%" PRIxPTR "\n", reinterpret_cast<uintptr_t>(iter->first)); } write(child_in[1], pprof_buffer, strlen(pprof_buffer)); close(child_in[1]); // that's all we need to write diff --git a/src/tcmalloc.cc b/src/tcmalloc.cc index fb0b692..e9b51a4 100644 --- a/src/tcmalloc.cc +++ b/src/tcmalloc.cc @@ -1005,7 +1005,7 @@ static void ReportLargeAlloc(Length num_pages, void* result) { static const int N = 1000; char buffer[N]; TCMalloc_Printer printer(buffer, N); - printer.printf("tcmalloc: large alloc %"PRIu64" bytes == %p @ ", + printer.printf("tcmalloc: large alloc %" PRIu64 " bytes == %p @ ", static_cast<uint64>(num_pages) << kPageShift, result); for (int i = 0; i < stack.depth; i++) { diff --git a/src/tests/markidle_unittest.cc b/src/tests/markidle_unittest.cc index 2f150ab..eb9898f 100644 --- a/src/tests/markidle_unittest.cc +++ b/src/tests/markidle_unittest.cc @@ -92,9 +92,9 @@ static void TestIdleUsage() { CHECK_LE(post_idle, original); // Log after testing because logging can allocate heap memory. - VLOG(0, "Original usage: %"PRIuS"\n", original); - VLOG(0, "Post allocation: %"PRIuS"\n", post_allocation); - VLOG(0, "Post idle: %"PRIuS"\n", post_idle); + VLOG(0, "Original usage: %" PRIuS "\n", original); + VLOG(0, "Post allocation: %" PRIuS "\n", post_allocation); + VLOG(0, "Post idle: %" PRIuS "\n", post_idle); } int main(int argc, char** argv) { diff --git a/src/tests/tcmalloc_unittest.cc b/src/tests/tcmalloc_unittest.cc index cfdc79c..079cad2 100644 --- a/src/tests/tcmalloc_unittest.cc +++ b/src/tests/tcmalloc_unittest.cc @@ -579,7 +579,7 @@ static void TestHugeAllocations(AllocatorState* rnd) { static void TestCalloc(size_t n, size_t s, bool ok) { char* p = reinterpret_cast<char*>(calloc(n, s)); if (FLAGS_verbose) - fprintf(LOGSTREAM, "calloc(%"PRIxS", %"PRIxS"): %p\n", n, s, p); + fprintf(LOGSTREAM, "calloc(%" PRIxS ", %" PRIxS "): %p\n", n, s, p); if (!ok) { CHECK(p == NULL); // calloc(n, s) should not succeed } else { |