From 0129c2b0fce64108feaf3ed61ccef9f376723a33 Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 20 Jan 2005 18:14:04 +0000 Subject: [PATCH] Fix some size_t printing. --- WHATS_NEW | 1 + lib/mm/dbg_malloc.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/WHATS_NEW b/WHATS_NEW index 5a3caf119..3483f2932 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.01.02 - =================================== + Fix some size_t printing. Fix 64 bit xlate consts. Split out pool sptype_names to avoid unused const. Always fail if random id generation fails. diff --git a/lib/mm/dbg_malloc.c b/lib/mm/dbg_malloc.c index f0f8a6b57..17f500777 100644 --- a/lib/mm/dbg_malloc.c +++ b/lib/mm/dbg_malloc.c @@ -48,13 +48,14 @@ void *malloc_aux(size_t s, const char *file, int line) size_t tsize = s + sizeof(*nb) + sizeof(unsigned long); if (s > 50000000) { - log_error("Huge memory allocation (size %" PRIuPTR + log_error("Huge memory allocation (size %" PRIsize_t ") rejected - metadata corruption?", s); return 0; } if (!(nb = malloc(tsize))) { - log_error("couldn't allocate any memory, size = %" PRIuPTR, s); + log_error("couldn't allocate any memory, size = %" PRIsize_t, + s); return 0; } @@ -190,7 +191,7 @@ int dump_memory(void) str[sizeof(str) - 1] = '\0'; print_log(_LOG_INFO, mb->file, mb->line, - "block %d at %p, size %" PRIdPTR "\t [%s]", + "block %d at %p, size %" PRIsize_t "\t [%s]", mb->id, mb->magic, mb->length, str); tot += mb->length; } @@ -220,7 +221,7 @@ void bounds_check(void) void *malloc_aux(size_t s, const char *file, int line) { if (s > 50000000) { - log_error("Huge memory allocation (size %" PRIuPTR + log_error("Huge memory allocation (size %" PRIsize_t ") rejected - metadata corruption?", s); return 0; }