diff options
| author | thorpej <thorpej@NetBSD.org> | 1999-07-04 03:12:47 +0000 |
|---|---|---|
| committer | thorpej <thorpej@NetBSD.org> | 1999-07-04 03:12:47 +0000 |
| commit | f759ceb8bfd3893660f74ba5d66bd28fbbb748b9 (patch) | |
| tree | f638a0a717f9e9a565409de6a5cee931f5721102 /lib/libc/stdlib/malloc.c | |
| parent | 5833a5a382ab8560027c9518cc5c1ac817b73288 (diff) | |
Only define MADV_FREE do MADV_DONTNEED if it's not already defined
by <sys/mman.h>.
Diffstat (limited to 'lib/libc/stdlib/malloc.c')
| -rw-r--r-- | lib/libc/stdlib/malloc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/libc/stdlib/malloc.c b/lib/libc/stdlib/malloc.c index 5a595282b39..6a3e63774eb 100644 --- a/lib/libc/stdlib/malloc.c +++ b/lib/libc/stdlib/malloc.c @@ -1,3 +1,5 @@ +/* $NetBSD: malloc.c,v 1.18 1999/07/04 03:12:47 thorpej Exp $ */ + /* * ---------------------------------------------------------------------------- * "THE BEER-WARE LICENSE" (Revision 42): @@ -69,7 +71,6 @@ # include <sys/param.h> # define malloc_pageshift PGSHIFT # define malloc_minsize 16U -# define MADV_FREE MADV_DONTNEED #endif /* __NetBSD__ */ #if defined(__sparc__) && defined(sun) @@ -81,7 +82,6 @@ # define INIT_MMAP() \ { if ((fdzero=open("/dev/zero", O_RDWR, 0000)) == -1) \ wrterror("open of /dev/zero"); } -# define MADV_FREE MADV_DONTNEED #endif /* __sparc__ */ /* Insert your combination here... */ @@ -187,6 +187,10 @@ struct pgfree { #define INIT_MMAP() #endif +#ifndef MADV_FREE +#define MADV_FREE MADV_DONTNEED +#endif + /* Set when initialization has been done */ static unsigned malloc_started; |
