diff options
author | phk <phk@FreeBSD.org> | 1997-08-27 12:04:33 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1997-08-27 12:04:33 +0000 |
commit | cb8d9886a95f231d2aed4570a64cf386dc69d068 (patch) | |
tree | 02159b690b7c93fa353583116c4cd8487d806fc3 /lib/libc/stdlib | |
parent | 510b497b0c82067d488492dd2d03bb8bd171fdf8 (diff) | |
download | FreeBSD-src-cb8d9886a95f231d2aed4570a64cf386dc69d068.zip FreeBSD-src-cb8d9886a95f231d2aed4570a64cf386dc69d068.tar.gz |
Improvement of type independency for the bitmap.
This makes 64bit operation more likely.
Reviewed by: phk
Submitted by: jdp
Diffstat (limited to 'lib/libc/stdlib')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 99d5d8b..1a79bbe 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -6,7 +6,7 @@ * this stuff is worth it, you can buy me a beer in return. Poul-Henning Kamp * ---------------------------------------------------------------------------- * - * $Id: malloc.c,v 1.29 1997/07/26 03:43:14 jdp Exp $ + * $Id: malloc.c,v 1.30 1997/08/27 06:40:34 phk Exp $ * */ @@ -84,6 +84,7 @@ #include <sys/mman.h> #include <errno.h> #include <fcntl.h> +#include <stddef.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -577,8 +578,8 @@ malloc_make_chunks(int bits) return 0; /* Find length of admin structure */ - l = sizeof *bp - sizeof(u_long); - l += sizeof(u_long) * + l = offsetof(struct pginfo, bits[0]); + l += sizeof bp->bits[0] * (((malloc_pagesize >> bits)+MALLOC_BITS-1) / MALLOC_BITS); /* Don't waste more than two chunks on this */ |