diff options
| author | christos <christos@NetBSD.org> | 2000-12-20 20:56:01 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2000-12-20 20:56:01 +0000 |
| commit | bebeeecd5b47845ba4133ecf98d3e79589487e63 (patch) | |
| tree | 1c062779799406026b9ff28957070f135fd4e376 /lib/libc/stdlib/malloc.c | |
| parent | d9ce410183804b2f41a4182bc6b63d9b992d01a7 (diff) | |
fix sbrk casts
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
| -rw-r--r-- | lib/libc/stdlib/malloc.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 30ef9973034..653b0e72fcc 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: malloc.c,v 1.33 2000/07/06 03:13:22 christos Exp $ */ +/* $NetBSD: malloc.c,v 1.34 2000/12/20 20:56:01 christos Exp $ */ /* * ---------------------------------------------------------------------------- @@ -298,7 +298,7 @@ map_pages(size_t pages) { caddr_t result, tail; - result = (caddr_t)pageround((size_t)(u_long)sbrk(0)); + result = (caddr_t)pageround((size_t)(u_long)sbrk((intptr_t)0)); tail = result + (pages << malloc_pageshift); if (brk(tail)) { @@ -464,7 +464,8 @@ malloc_init (void) * We need a maximum of malloc_pageshift buckets, steal these from the * front of the page_directory; */ - malloc_origo = pageround((size_t)(u_long)sbrk(0)) >> malloc_pageshift; + malloc_origo = pageround((size_t)(u_long)sbrk((intptr_t)0)) + >> malloc_pageshift; malloc_origo -= malloc_pageshift; malloc_ninfo = malloc_pagesize / sizeof *page_dir; @@ -924,7 +925,7 @@ free_pages(void *ptr, size_t idx, struct pginfo *info) if (!pf->next && /* If we're the last one, */ pf->size > malloc_cache && /* ..and the cache is full, */ pf->end == malloc_brk && /* ..and none behind us, */ - malloc_brk == sbrk(0)) { /* ..and it's OK to do... */ + malloc_brk == sbrk((intptr_t)0)) { /* ..and it's OK to do... */ /* * Keep the cache intact. Notice that the '>' above guarantees that |
