From 83cbddd78e472fce473b606156068bd8ce634e90 Mon Sep 17 00:00:00 2001 From: otto <> Date: Sun, 20 Aug 2017 11:06:16 +0000 Subject: [PATCH] two MALLOC_STATS only tweaks; one from David CARLIER, the other found by clang --- src/lib/libc/stdlib/malloc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index 22f83f35..c7ef59b6 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: malloc.c,v 1.228 2017/07/10 09:44:16 otto Exp $ */ +/* $OpenBSD: malloc.c,v 1.229 2017/08/20 11:06:16 otto Exp $ */ /* * Copyright (c) 2008, 2010, 2011, 2016 Otto Moerbeek * Copyright (c) 2012 Matthew Dempsky @@ -293,12 +293,8 @@ wrterror(struct dir_info *d, char *msg, ...) writev(STDERR_FILENO, iov, 3); #ifdef MALLOC_STATS - if (mopts.malloc_stats) { - int i; - - for (i = 0; i < _MALLOC_MUTEXES; i++) - malloc_dump(STDERR_FILENO, i, mopts.malloc_pool[i]); - } + if (mopts.malloc_stats) + malloc_gdump(STDERR_FILENO); #endif /* MALLOC_STATS */ errno = saved_errno; @@ -2080,7 +2076,7 @@ err: #ifdef MALLOC_STATS struct malloc_leak { - void (*f)(); + void *f; size_t total_size; int count; };