diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-03-04 22:41:05 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2005-03-04 22:41:05 +0000 |
commit | a4385619703fa827222d5c66f6db70c70b021412 (patch) | |
tree | e3c4b327f859ee9e4d91a3dc71a1b9184d135bfd | |
parent | 53b10bfa96755dec80fc1a75cf395c2d0941e334 (diff) |
fix the MALLOC macro if built without malloc statistics. this won't
affect GENERIC.
ok deraadt@ miod@
-rw-r--r-- | sys/sys/malloc.h | 7 |
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); \ |