Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/stdlib Avoid sysconf: __sysconf -> sysctlgetmibinfo...
details: https://anonhg.NetBSD.org/src/rev/3c156aa1fe56
branches: trunk
changeset: 820601:3c156aa1fe56
user: christos <christos%NetBSD.org@localhost>
date: Thu Jan 12 02:00:42 2017 +0000
description:
Avoid sysconf: __sysconf -> sysctlgetmibinfo -> strtoimax -> locale, etc.
diffstat:
lib/libc/stdlib/malloc.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diffs (30 lines):
diff -r 43edccc7ee8b -r 3c156aa1fe56 lib/libc/stdlib/malloc.c
--- a/lib/libc/stdlib/malloc.c Thu Jan 12 01:58:39 2017 +0000
+++ b/lib/libc/stdlib/malloc.c Thu Jan 12 02:00:42 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: malloc.c,v 1.57 2017/01/12 01:02:09 christos Exp $ */
+/* $NetBSD: malloc.c,v 1.58 2017/01/12 02:00:42 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.57 2017/01/12 01:02:09 christos Exp $");
+__RCSID("$NetBSD: malloc.c,v 1.58 2017/01/12 02:00:42 christos Exp $");
# endif /* LIBC_SCCS and not lint */
# include <reentrant.h>
# ifdef _REENTRANT
@@ -458,7 +458,11 @@
/*
* Compute page-size related variables.
*/
+#ifdef _LIBC
malloc_pagesize = (size_t)sysconf(_SC_PAGESIZE);
+#else
+ malloc_pagesize = 4096;
+#endif
malloc_pagemask = malloc_pagesize - 1;
for (malloc_pageshift = 0;
(1UL << malloc_pageshift) != malloc_pagesize;
Home |
Main Index |
Thread Index |
Old Index