diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libc/stdlib/malloc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c index 976880e757..9682f91cda 100644 --- a/src/lib/libc/stdlib/malloc.c +++ b/src/lib/libc/stdlib/malloc.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: malloc.c,v 1.138 2011/06/20 18:04:06 tedu Exp $ */ | 1 | /* $OpenBSD: malloc.c,v 1.139 2011/07/12 14:43:42 otto Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net> | 3 | * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net> |
4 | * | 4 | * |
@@ -68,6 +68,8 @@ | |||
68 | #define MALLOC_MAXCACHE 256 | 68 | #define MALLOC_MAXCACHE 256 |
69 | #define MALLOC_DELAYED_CHUNKS 15 /* max of getrnibble() */ | 69 | #define MALLOC_DELAYED_CHUNKS 15 /* max of getrnibble() */ |
70 | #define MALLOC_INITIAL_REGIONS 512 | 70 | #define MALLOC_INITIAL_REGIONS 512 |
71 | #define MALLOC_DEFAULT_CACHE 64 | ||
72 | |||
71 | /* | 73 | /* |
72 | * When the P option is active, we move allocations between half a page | 74 | * When the P option is active, we move allocations between half a page |
73 | * and a whole page towards the end, subject to alignment constraints. | 75 | * and a whole page towards the end, subject to alignment constraints. |
@@ -461,7 +463,7 @@ omalloc_init(struct dir_info **dp) | |||
461 | */ | 463 | */ |
462 | mopts.malloc_abort = 1; | 464 | mopts.malloc_abort = 1; |
463 | mopts.malloc_move = 1; | 465 | mopts.malloc_move = 1; |
464 | mopts.malloc_cache = 64; | 466 | mopts.malloc_cache = MALLOC_DEFAULT_CACHE; |
465 | 467 | ||
466 | for (i = 0; i < 3; i++) { | 468 | for (i = 0; i < 3; i++) { |
467 | switch (i) { | 469 | switch (i) { |
@@ -551,10 +553,12 @@ omalloc_init(struct dir_info **dp) | |||
551 | case 's': | 553 | case 's': |
552 | mopts.malloc_freeprot = mopts.malloc_junk = 0; | 554 | mopts.malloc_freeprot = mopts.malloc_junk = 0; |
553 | mopts.malloc_guard = 0; | 555 | mopts.malloc_guard = 0; |
556 | mopts.malloc_cache = MALLOC_DEFAULT_CACHE; | ||
554 | break; | 557 | break; |
555 | case 'S': | 558 | case 'S': |
556 | mopts.malloc_freeprot = mopts.malloc_junk = 1; | 559 | mopts.malloc_freeprot = mopts.malloc_junk = 1; |
557 | mopts.malloc_guard = MALLOC_PAGESIZE; | 560 | mopts.malloc_guard = MALLOC_PAGESIZE; |
561 | mopts.malloc_cache = 0; | ||
558 | break; | 562 | break; |
559 | case 'x': | 563 | case 'x': |
560 | mopts.malloc_xmalloc = 0; | 564 | mopts.malloc_xmalloc = 0; |