Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/stdlib use getpagesize(3).
details: https://anonhg.NetBSD.org/src/rev/1f95bb63c71d
branches: trunk
changeset: 350507:1f95bb63c71d
user: christos <christos%NetBSD.org@localhost>
date: Fri Jan 13 04:18:54 2017 +0000
description:
use getpagesize(3).
diffstat:
lib/libc/stdlib/malloc.c | 10 +++-------
1 files changed, 3 insertions(+), 7 deletions(-)
diffs (31 lines):
diff -r e264e619e7ce -r 1f95bb63c71d lib/libc/stdlib/malloc.c
--- a/lib/libc/stdlib/malloc.c Fri Jan 13 03:01:09 2017 +0000
+++ b/lib/libc/stdlib/malloc.c Fri Jan 13 04:18:54 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: malloc.c,v 1.58 2017/01/12 02:00:42 christos Exp $ */
+/* $NetBSD: malloc.c,v 1.59 2017/01/13 04:18:54 christos Exp $ */
/*
* ----------------------------------------------------------------------------
@@ -93,7 +93,7 @@
# include <sys/cdefs.h>
# include "extern.h"
# if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: malloc.c,v 1.58 2017/01/12 02:00:42 christos Exp $");
+__RCSID("$NetBSD: malloc.c,v 1.59 2017/01/13 04:18:54 christos Exp $");
# endif /* LIBC_SCCS and not lint */
# include <reentrant.h>
# ifdef _REENTRANT
@@ -458,11 +458,7 @@
/*
* Compute page-size related variables.
*/
-#ifdef _LIBC
- malloc_pagesize = (size_t)sysconf(_SC_PAGESIZE);
-#else
- malloc_pagesize = 4096;
-#endif
+ malloc_pagesize = getpagesize();
malloc_pagemask = malloc_pagesize - 1;
for (malloc_pageshift = 0;
(1UL << malloc_pageshift) != malloc_pagesize;
Home |
Main Index |
Thread Index |
Old Index