diff options
author | Alan Cox <alc@FreeBSD.org> | 2009-11-02 18:44:01 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2009-11-02 18:44:01 +0000 |
commit | 225da9692c84acb9effede31c7b3fa9198e90d95 (patch) | |
tree | 2892520abbc604e80f40f989978c2f5cd67db78f /lib/libc/stdlib/malloc.c | |
parent | 55dd54d73fecd7e4b7d2e34b5c802b9db582b769 (diff) |
Notes
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 8b13d1218d96..80e26e66ec61 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -4795,6 +4795,21 @@ malloc_init_hard(void) } } + /* + * Increase the chunk size to the largest page size that is greater + * than the default chunk size and less than or equal to 4MB. + */ + { + size_t pagesizes[MAXPAGESIZES]; + int k, nsizes; + + nsizes = getpagesizes(pagesizes, MAXPAGESIZES); + for (k = 0; k < nsizes; k++) + if (pagesizes[k] <= (1LU << 22)) + while ((1LU << opt_chunk_2pow) < pagesizes[k]) + opt_chunk_2pow++; + } + for (i = 0; i < 3; i++) { unsigned j; |