Browse Source

two MALLOC_STATS only tweaks; one from David CARLIER, the other found by clang

OPENBSD_6_2
otto 6 years ago
parent
commit
83cbddd78e
1 changed files with 4 additions and 8 deletions
  1. +4
    -8
      src/lib/libc/stdlib/malloc.c

+ 4
- 8
src/lib/libc/stdlib/malloc.c View File

@ -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 <otto@drijf.net>
* Copyright (c) 2012 Matthew Dempsky <matthew@openbsd.org>
@ -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;
};


Loading…
Cancel
Save