diff options
author | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2021-02-14 14:04:10 -0800 |
---|---|---|
committer | Aliaksey Kandratsenka <alkondratenko@gmail.com> | 2021-02-14 15:44:14 -0800 |
commit | 0d6f32b9cef7ee044e55a746e7c76db62d23cd86 (patch) | |
tree | c805a20502e080889752bd8d9e5021ec9239aa92 | |
parent | 0c11d35f4a2a0f5f42ee684a3f5b27cbab8abae2 (diff) | |
download | gperftools-0d6f32b9cef7ee044e55a746e7c76db62d23cd86.tar.gz |
use standard way to print size_t-sized ints
I.e. just use zu/zd/zx instead of finding out right size and defining
PRI{u,x,d}S defines. Compilers have long caught up to this part of
standard.
-rw-r--r-- | cmake/config.h.in | 9 | ||||
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | m4/compiler_characteristics.m4 | 24 | ||||
-rw-r--r-- | src/debugallocation.cc | 8 | ||||
-rw-r--r-- | src/emergency_malloc.cc | 2 | ||||
-rw-r--r-- | src/heap-checker.cc | 28 | ||||
-rw-r--r-- | src/heap-profile-table.cc | 6 | ||||
-rw-r--r-- | src/heap-profiler.cc | 16 | ||||
-rw-r--r-- | src/memory_region_map.cc | 16 | ||||
-rw-r--r-- | src/profiledata.cc | 2 | ||||
-rw-r--r-- | src/tcmalloc.cc | 2 | ||||
-rw-r--r-- | src/tests/markidle_unittest.cc | 12 | ||||
-rw-r--r-- | src/tests/tcmalloc_unittest.cc | 2 | ||||
-rw-r--r-- | src/windows/config.h | 21 |
14 files changed, 47 insertions, 104 deletions
diff --git a/cmake/config.h.in b/cmake/config.h.in index c5f0a1f..baaa5b0 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -280,15 +280,6 @@ #endif #endif -/* printf format code for printing a size_t and ssize_t */ -#define PRIdS "zd" - -/* printf format code for printing a size_t and ssize_t */ -#define PRIuS "zu" - -/* printf format code for printing a size_t and ssize_t */ -#define PRIxS "zx" - /* Mark the systems where we know it's bad if pthreads runs too early before main (before threads are initialized, presumably). */ #ifdef __FreeBSD__ diff --git a/configure.ac b/configure.ac index 5a8c0ff..e809386 100644 --- a/configure.ac +++ b/configure.ac @@ -451,9 +451,6 @@ AC_ARG_ENABLE([emergency-malloc], AM_CONDITIONAL(BUILD_EMERGENCY_MALLOC, [test "x$enable_emergency_malloc" = xyes]) -# Defines PRIuS -AC_COMPILER_CHARACTERISTICS - # Also make sure we get standard PRI... definitions, even with glibc. # We have to use AH_VERBATIM because we need the #ifdef guard (gcc buglet) AH_VERBATIM([__STDC_FORMAT_MACROS], diff --git a/m4/compiler_characteristics.m4 b/m4/compiler_characteristics.m4 deleted file mode 100644 index 2b62893..0000000 --- a/m4/compiler_characteristics.m4 +++ /dev/null @@ -1,24 +0,0 @@ -# Check compiler characteristics (e.g. type sizes, PRIxx macros, ...) - -# If types $1 and $2 are compatible, perform action $3 -AC_DEFUN([AC_TYPES_COMPATIBLE], - [AC_TRY_COMPILE([#include <stddef.h>], [$1 v1 = 0; $2 v2 = 0; return (&v1 - &v2)], $3)]) - -define(AC_PRIUS_COMMENT, [printf format code for printing a size_t and ssize_t]) - -AC_DEFUN([AC_COMPILER_CHARACTERISTICS], - [AC_CACHE_CHECK(AC_PRIUS_COMMENT, ac_cv_formatting_prius_prefix, - [AC_TYPES_COMPATIBLE(unsigned int, size_t, - ac_cv_formatting_prius_prefix=; ac_cv_prius_defined=1) - AC_TYPES_COMPATIBLE(unsigned long, size_t, - ac_cv_formatting_prius_prefix=l; ac_cv_prius_defined=1) - AC_TYPES_COMPATIBLE(unsigned long long, size_t, - ac_cv_formatting_prius_prefix=ll; ac_cv_prius_defined=1 - )]) - if test -z "$ac_cv_prius_defined"; then - ac_cv_formatting_prius_prefix=z; - fi - AC_DEFINE_UNQUOTED(PRIuS, "${ac_cv_formatting_prius_prefix}u", AC_PRIUS_COMMENT) - AC_DEFINE_UNQUOTED(PRIxS, "${ac_cv_formatting_prius_prefix}x", AC_PRIUS_COMMENT) - AC_DEFINE_UNQUOTED(PRIdS, "${ac_cv_formatting_prius_prefix}d", AC_PRIUS_COMMENT) -]) diff --git a/src/debugallocation.cc b/src/debugallocation.cc index 39dea5a..17cd452 100644 --- a/src/debugallocation.cc +++ b/src/debugallocation.cc @@ -503,7 +503,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: %zu", size); return NULL; } MallocBlock* b = NULL; @@ -1003,7 +1003,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%zu\t%p\t%" GPRIuPTHREAD, \ name, size, addr, PRINTABLE_PTHREAD(pthread_self())); \ TraceStack(); \ TracePrintf(TraceFd(), "\n"); \ @@ -1320,7 +1320,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 %zu bytes: new failed.", size); } return ptr; } @@ -1355,7 +1355,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 %zu bytes: new[] failed.", size); } return ptr; } diff --git a/src/emergency_malloc.cc b/src/emergency_malloc.cc index 81c5554..6c0946a 100644 --- a/src/emergency_malloc.cc +++ b/src/emergency_malloc.cc @@ -56,7 +56,7 @@ namespace tcmalloc { void *MapPages(int32 flags, size_t size) { char *new_end = emergency_arena_end + size; if (new_end > emergency_arena_start + kEmergencyArenaSize) { - RAW_LOG(FATAL, "Unable to allocate %" PRIuS " bytes in emergency zone.", size); + RAW_LOG(FATAL, "Unable to allocate %zu bytes in emergency zone.", size); } char *rv = emergency_arena_end; emergency_arena_end = new_end; diff --git a/src/heap-checker.cc b/src/heap-checker.cc index 8e71f58..199fc93 100644 --- a/src/heap-checker.cc +++ b/src/heap-checker.cc @@ -568,7 +568,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 %zu; %d", ptr, size, int(counter)); // Fetch the caller's stack trace before acquiring heap_checker_lock. @@ -588,7 +588,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 %zu", ptr, size); } } @@ -771,14 +771,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 %zu 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 %zu bytes at %p", (stack_disable ? "Stack" : "Range"), info.object_size, ptr); live_objects->push_back(AllocObject(ptr, info.object_size, MUST_BE_ON_HEAP)); @@ -1070,7 +1070,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 %zu bytes", &thread_registers[0], thread_registers.size() * sizeof(void*)); live_objects->push_back(AllocObject(&thread_registers[0], thread_registers.size() * sizeof(void*), @@ -1107,7 +1107,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 %zu bytes", ptr, object->second); live_objects-> push_back(AllocObject(ptr, object->second, MUST_BE_ON_HEAP)); @@ -1116,7 +1116,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 %zu bytes from an" " IgnoreObject() has disappeared", ptr, object->second); } } @@ -1404,7 +1404,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 %zu bytes", object, size); const char* const whole_object = object; size_t const whole_size = size; @@ -1475,8 +1475,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 %zu bytes at %p " + "inside %p of size %zu", 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 @@ -1523,7 +1523,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 %zu bytes", ptr, object_size); if (ignored_objects == NULL) { ignored_objects = new(Allocator::Allocate(sizeof(IgnoredObjectsMap))) @@ -1550,7 +1550,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 %zu bytes", ptr, object_size); } } if (!found) RAW_LOG(FATAL, "Object at %p has not been ignored", ptr); @@ -1598,8 +1598,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: %zu bytes " + "in %zu objects", name_, start_inuse_bytes, start_inuse_allocs); } else { RAW_LOG(WARNING, "Heap checker is not active, " diff --git a/src/heap-profile-table.cc b/src/heap-profile-table.cc index c3ce41c..f1dc3d2 100644 --- a/src/heap-profile-table.cc +++ b/src/heap-profile-table.cc @@ -549,8 +549,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 %zu bytes " + "in %zu objects", checker_name, size_t(total_.alloc_size), size_t(total_.allocs)); @@ -620,7 +620,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 %zu byte object %p", v->bytes, ptr); } void HeapProfileTable::Snapshot::ReportIndividualObjects() { diff --git a/src/heap-profiler.cc b/src/heap-profiler.cc index 33a25ac..afb34e5 100644 --- a/src/heap-profiler.cc +++ b/src/heap-profiler.cc @@ -360,11 +360,11 @@ static void RawInfoStackDumper(const char* message, void*) { static void MmapHook(const void* result, const void* start, size_t size, int prot, int flags, int fd, off_t offset) { if (FLAGS_mmap_log) { // log it - // We use PRIxS not just '%p' to avoid deadlocks + // We use PRIxPTR 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, - "mmap(start=0x%" PRIxPTR ", len=%" PRIuS ", prot=0x%x, flags=0x%x, " + "mmap(start=0x%" PRIxPTR ", len=%zu, 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); @@ -378,12 +378,12 @@ static void MremapHook(const void* result, const void* old_addr, size_t old_size, size_t new_size, int flags, const void* new_addr) { if (FLAGS_mmap_log) { // log it - // We use PRIxS not just '%p' to avoid deadlocks + // We use PRIxPTR 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, - "mremap(old_addr=0x%" PRIxPTR ", old_size=%" PRIuS ", " - "new_size=%" PRIuS ", flags=0x%x, new_addr=0x%" PRIxPTR ") = " + "mremap(old_addr=0x%" PRIxPTR ", old_size=%zu, " + "new_size=%zu, 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); @@ -395,10 +395,10 @@ static void MremapHook(const void* result, const void* old_addr, static void MunmapHook(const void* ptr, size_t size) { if (FLAGS_mmap_log) { // log it - // We use PRIxS not just '%p' to avoid deadlocks + // We use PRIxPTR 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=%zu)", (uintptr_t) ptr, size); #ifdef TODO_REENABLE_STACK_TRACING DumpStackTrace(1, RawInfoStackDumper, NULL); @@ -408,7 +408,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=%zd) = 0x%" PRIxPTR "", increment, (uintptr_t) result); #ifdef TODO_REENABLE_STACK_TRACING DumpStackTrace(1, RawInfoStackDumper, NULL); diff --git a/src/memory_region_map.cc b/src/memory_region_map.cc index 06b6fb0..da5adb9 100644 --- a/src/memory_region_map.cc +++ b/src/memory_region_map.cc @@ -682,7 +682,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 %zu regions", reinterpret_cast<void*>(start_addr), reinterpret_cast<void*>(end_addr), regions_->size()); @@ -749,7 +749,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 %zu regions", reinterpret_cast<void*>(start_addr), reinterpret_cast<void*>(end_addr), regions_->size()); @@ -772,9 +772,9 @@ 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%" PRIxPTR " 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 " " + RAW_VLOG(10, "MMap = 0x%" PRIxPTR " of %zu at %" PRIu64 " " "prot %d flags %d fd %d offs %" PRId64, reinterpret_cast<uintptr_t>(result), size, reinterpret_cast<uint64>(start), prot, flags, fd, @@ -785,7 +785,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 %zu", ptr, size); if (size != 0) { RecordRegionRemoval(ptr, size); } @@ -795,8 +795,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 " %zu " + "to %zu 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); @@ -807,7 +807,7 @@ void MemoryRegionMap::MremapHook(const void* result, } 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 %zd", (uintptr_t)result, increment); if (result != reinterpret_cast<void*>(-1)) { if (increment > 0) { void* new_end = sbrk(0); diff --git a/src/profiledata.cc b/src/profiledata.cc index 8b05d3a..7bfb727 100644 --- a/src/profiledata.cc +++ b/src/profiledata.cc @@ -192,7 +192,7 @@ void ProfileData::Stop() { DumpProcSelfMaps(out_); Reset(); - fprintf(stderr, "PROFILE: interrupts/evictions/bytes = %d/%d/%" PRIuS "\n", + fprintf(stderr, "PROFILE: interrupts/evictions/bytes = %d/%d/%zu\n", count_, evictions_, total_bytes_); } diff --git a/src/tcmalloc.cc b/src/tcmalloc.cc index 4e1460d..ab7e1f6 100644 --- a/src/tcmalloc.cc +++ b/src/tcmalloc.cc @@ -478,7 +478,7 @@ static void DumpStats(TCMalloc_Printer* out, int level) { const uint64_t class_overhead = Static::central_cache()[cl].OverheadBytes(); cumulative_overhead += class_overhead; - out->printf("class %3d [ %8" PRIuS " bytes ] : " + out->printf("class %3d [ %8zu bytes ] : " "%8" PRIu64 " objs; %5.1f MiB; %5.1f cum MiB; " "%8.3f overhead MiB; %8.3f cum overhead MiB\n", cl, cl_size, diff --git a/src/tests/markidle_unittest.cc b/src/tests/markidle_unittest.cc index 92b4cc4..bdd14f1 100644 --- a/src/tests/markidle_unittest.cc +++ b/src/tests/markidle_unittest.cc @@ -93,9 +93,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: %zu\n", original); + VLOG(0, "Post allocation: %zu\n", post_allocation); + VLOG(0, "Post idle: %zu\n", post_idle); } static void TestTemporarilyIdleUsage() { @@ -110,9 +110,9 @@ static void TestTemporarilyIdleUsage() { CHECK_EQ(post_idle, 0); // 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: %zu\n", original); + VLOG(0, "Post allocation: %zu\n", post_allocation); + VLOG(0, "Post idle: %zu\n", post_idle); } int main(int argc, char** argv) { diff --git a/src/tests/tcmalloc_unittest.cc b/src/tests/tcmalloc_unittest.cc index 9d30343..d4d031f 100644 --- a/src/tests/tcmalloc_unittest.cc +++ b/src/tests/tcmalloc_unittest.cc @@ -634,7 +634,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(%zx, %zx): %p\n", n, s, p); if (!ok) { CHECK(p == NULL); // calloc(n, s) should not succeed } else { diff --git a/src/windows/config.h b/src/windows/config.h index bbc1bb0..24692b5 100644 --- a/src/windows/config.h +++ b/src/windows/config.h @@ -271,27 +271,6 @@ # define PERFTOOLS_DLL_DECL_FOR_UNITTESTS __declspec(dllimport) #endif -/* printf format code for printing a size_t and ssize_t */ -#ifdef _WIN64 -#define PRIdS "lld" -#else -#define PRIdS "d" -#endif - -/* printf format code for printing a size_t and ssize_t */ -#ifdef _WIN64 -#define PRIuS "llu" -#else -#define PRIuS "u" -#endif - -/* printf format code for printing a size_t and ssize_t */ -#ifdef _WIN64 -#define PRIxS "llx" -#else -#define PRIxS "x" -#endif - /* Mark the systems where we know it's bad if pthreads runs too early before main (before threads are initialized, presumably). */ #ifdef __FreeBSD__ |