diff options
author | phk <phk@FreeBSD.org> | 1995-12-18 12:03:54 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1995-12-18 12:03:54 +0000 |
commit | fbbda41bed9c6c09bfe90f879c926347e8ba3b99 (patch) | |
tree | 168d0d3777f60db7ad24f558f8f13e53d904354f /lib/libc/stdlib/malloc.c | |
parent | 7e3aca710dd7cb4798ff0b5eb8e6a1208fa82ed7 (diff) | |
download | FreeBSD-src-fbbda41bed9c6c09bfe90f879c926347e8ba3b99.zip FreeBSD-src-fbbda41bed9c6c09bfe90f879c926347e8ba3b99.tar.gz |
Preallocate a small structure, so we can sbrk(2) further back.
Reviewed by: phk
Submitted by: Kaleb Keithly <kaleb@x.org>
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
-rw-r--r-- | lib/libc/stdlib/malloc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index cc24045..d906774 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.6 1995/10/22 14:47:00 phk Exp $ + * $Id: malloc.c,v 1.7 1995/12/11 14:28:12 peter Exp $ * */ @@ -595,6 +595,12 @@ malloc_init () /* Been here, done that */ initialized++; + + /* + * This is a nice hack from Kaleb Keithly (kaleb@x.org). + * We can sbrk(2) further back when we keep this on a low address. + */ + px = (struct pgfree *) malloc (sizeof *px); } /* @@ -990,7 +996,7 @@ free_pages(void *ptr, int index, struct pginfo *info) pf = px; px = 0; } else if (pf->end == ptr ) { - /* Append to the previuos entry */ + /* Append to the previous entry */ pf->end += l; pf->size += l; if (pf->next && pf->end == pf->next->page ) { |