summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/sys/malloc.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h
index 6e2f05be26f..68992d7024d 100644
--- a/sys/sys/malloc.h
+++ b/sys/sys/malloc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: malloc.h,v 1.76 2005/01/14 21:15:08 mcbride Exp $ */
+/* $OpenBSD: malloc.h,v 1.77 2005/03/04 22:41:04 reyk Exp $ */
/* $NetBSD: malloc.h,v 1.39 1998/07/12 19:52:01 augustss Exp $ */
/*
@@ -401,10 +401,11 @@ struct kmembuckets {
#else /* do not collect statistics */
#define MALLOC(space, cast, size, type, flags) do { \
- register struct kmembuckets *kbp = &bucket[BUCKETINDX(size)]; \
+ u_long kbp_size = (u_long)(size); \
+ register struct kmembuckets *kbp = &bucket[BUCKETINDX(kbp_size)]; \
long __s = splvm(); \
if (kbp->kb_next == NULL) { \
- (space) = (cast)malloc((u_long)(size), type, flags); \
+ (space) = (cast)malloc(kbp_size, type, flags); \
} else { \
(space) = (cast)kbp->kb_next; \
kbp->kb_next = *(caddr_t *)(space); \