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 /src/debugallocation.cc | |
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.
Diffstat (limited to 'src/debugallocation.cc')
-rw-r--r-- | src/debugallocation.cc | 8 |
1 files changed, 4 insertions, 4 deletions
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; } |