summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libc/stdlib/malloc.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libc/stdlib/malloc.c b/src/lib/libc/stdlib/malloc.c
index ad5ce94d54..d9211e2641 100644
--- a/src/lib/libc/stdlib/malloc.c
+++ b/src/lib/libc/stdlib/malloc.c
@@ -8,7 +8,7 @@
8 */ 8 */
9 9
10#if defined(LIBC_SCCS) && !defined(lint) 10#if defined(LIBC_SCCS) && !defined(lint)
11static char rcsid[] = "$OpenBSD: malloc.c,v 1.40 2000/04/10 19:36:29 deraadt Exp $"; 11static char rcsid[] = "$OpenBSD: malloc.c,v 1.41 2001/05/10 16:14:19 art Exp $";
12#endif /* LIBC_SCCS and not lint */ 12#endif /* LIBC_SCCS and not lint */
13 13
14/* 14/*
@@ -243,7 +243,7 @@ static int malloc_silent;
243/* always realloc ? */ 243/* always realloc ? */
244static int malloc_realloc; 244static int malloc_realloc;
245 245
246#ifdef __FreeBSD__ 246#if defined(__FreeBSD__) || (defined(__OpenBSD__) && defined(MADV_FREE))
247/* pass the kernel a hint on free pages ? */ 247/* pass the kernel a hint on free pages ? */
248static int malloc_hint; 248static int malloc_hint;
249#endif 249#endif
@@ -547,7 +547,7 @@ malloc_init ()
547 case 'd': malloc_stats = 0; break; 547 case 'd': malloc_stats = 0; break;
548 case 'D': malloc_stats = 1; break; 548 case 'D': malloc_stats = 1; break;
549#endif /* MALLOC_STATS */ 549#endif /* MALLOC_STATS */
550#ifdef __FreeBSD__ 550#if defined(__FreeBSD__) || (defined(__OpenBSD__) && defined(MADV_FREE))
551 case 'h': malloc_hint = 0; break; 551 case 'h': malloc_hint = 0; break;
552 case 'H': malloc_hint = 1; break; 552 case 'H': malloc_hint = 1; break;
553#endif /* __FreeBSD__ */ 553#endif /* __FreeBSD__ */
@@ -1004,7 +1004,7 @@ free_pages(ptr, index, info)
1004 if (malloc_junk) 1004 if (malloc_junk)
1005 memset(ptr, SOME_JUNK, l); 1005 memset(ptr, SOME_JUNK, l);
1006 1006
1007#ifdef __FreeBSD__ 1007#if defined(__FreeBSD__) || (defined(__OpenBSD__) && defined(MADV_FREE))
1008 if (malloc_hint) 1008 if (malloc_hint)
1009 madvise(ptr, l, MADV_FREE); 1009 madvise(ptr, l, MADV_FREE);
1010#endif 1010#endif