summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2014-07-10 22:16:49 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2014-07-10 22:16:49 +0000
commit0a61811ee522d9344f0ff2ce98c53609fc20cfac (patch)
treec8ae6ccb788bc8e1443f2bb6cb050d631b9433b3 /sys/kern
parent99b1adcb61806b0a6152aa1f9ddf8e9e2beba26b (diff)
instead of defining two versions of bucketidx, just don't inline for small.
ok deraadt
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/kern_malloc.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c
index f071962cd9a..83936778a0d 100644
--- a/sys/kern/kern_malloc.c
+++ b/sys/kern/kern_malloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc.c,v 1.111 2014/07/10 19:33:16 matthew Exp $ */
+/* $OpenBSD: kern_malloc.c,v 1.112 2014/07/10 22:16:48 tedu Exp $ */
/* $NetBSD: kern_malloc.c,v 1.15.4.2 1996/06/13 17:10:56 cgd Exp $ */
/*
@@ -45,18 +45,12 @@
#include <uvm/uvm_extern.h>
-static __inline__ long BUCKETINDX(size_t sz)
+static
+#ifndef SMALL_KERNEL
+__inline__
+#endif
+long BUCKETINDX(size_t sz)
{
-#ifdef SMALL_KERNEL
- long b;
-
- if (sz-- == 0)
- return MINBUCKET;
-
- for (b = MINBUCKET; b < MINBUCKET + 15; b++)
- if ((sz >> b) == 0)
- break;
-#else
long b, d;
/* note that this relies upon MINALLOCSIZE being 1 << MINBUCKET */
@@ -72,8 +66,6 @@ static __inline__ long BUCKETINDX(size_t sz)
b += 0;
else
b += 1;
-#endif
-
return b;
}