summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_malloc_debug.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2001-07-17 15:49:22 +0000
committerart <art@openbsd.org>2001-07-17 15:49:22 +0000
commitb5f203e12357e2efdbb7babb0bffff490b67b61a (patch)
tree4da429f9389b60e197f5a090eb6036d471db3577 /sys/kern/kern_malloc_debug.c
parentchange jaut back to previous behavior; add new "login" command (diff)
downloadwireguard-openbsd-b5f203e12357e2efdbb7babb0bffff490b67b61a.tar.xz
wireguard-openbsd-b5f203e12357e2efdbb7babb0bffff490b67b61a.zip
Since normal malloc reports "data modified on free list" with
the size we are trying to allocate and not the size of the bucket and malloc_debug is not capable of debugging a prticular bucket, only a size, add a possibility to specify a size range.
Diffstat (limited to 'sys/kern/kern_malloc_debug.c')
-rw-r--r--sys/kern/kern_malloc_debug.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/kern_malloc_debug.c b/sys/kern/kern_malloc_debug.c
index 42fb53e11b6..75c61259a19 100644
--- a/sys/kern/kern_malloc_debug.c
+++ b/sys/kern/kern_malloc_debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc_debug.c,v 1.6 2001/06/27 04:49:43 art Exp $ */
+/* $OpenBSD: kern_malloc_debug.c,v 1.7 2001/07/17 15:49:22 art Exp $ */
/*
* Copyright (c) 1999, 2000 Artur Grabowski <art@openbsd.org>
@@ -74,6 +74,8 @@
*/
int malloc_deb_type = -1;
int malloc_deb_size = -1;
+int malloc_deb_size_lo = -1;
+int malloc_deb_size_hi = -1;
/*
* MALLOC_DEBUG_CHUNKS is the number of memory chunks we require on the
@@ -122,6 +124,7 @@ debug_malloc(size, type, flags, addr)
if ((type != malloc_deb_type && malloc_deb_type != 0) ||
(size != malloc_deb_size && malloc_deb_size != 0) ||
+ (size < malloc_deb_size_lo || size > malloc_deb_size_hi) ||
type == M_DEBUG)
return 0;