summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-11-05 17:44:55 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-11-05 17:44:55 +0000
commit434a5bd0868e3c842b9342d6f428d0721939afa7 (patch)
tree3d86c8e88b9951ebc2d55abee47a7108db798eba
parent3a5c6672bb5b8dea7734d593703e25dc34ad2197 (diff)
use memname to print string of type. stolen from deraadt
-rw-r--r--sys/kern/kern_malloc.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index afc154e52da..cd86c858745 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc.c,v 1.118 2014/11/05 17:43:04 tedu Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.119 2014/11/05 17:44:54 tedu Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
@@ -387,11 +387,11 @@ free(void *addr, int type, size_t freedsize)
s = splvm();
#ifdef DIAGNOSTIC
if (freedsize != 0 && freedsize > size)
- panic("free: size too large %zu > %ld (%p) type %d",
- freedsize, size, addr, type);
+ panic("free: size too large %zu > %ld (%p) type %s",
+ freedsize, size, addr, memname[type]);
if (freedsize != 0 && size > MINALLOCSIZE && freedsize < size / 2)
- panic("free: size too small %zu < %ld / 2 (%p) type %d",
- freedsize, size, addr, type);
+ panic("free: size too small %zu < %ld / 2 (%p) type %s",
+ freedsize, size, addr, memname[type]);
/*
* Check for returns of data that do not point to the
* beginning of the allocation.