Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2022-09-16 23:04:21 +0300
committerJeff Johnston <jjohnstn@redhat.com>2022-09-19 22:35:55 +0300
commit5230eb7f8c6b43c71d7e38d138935c48de930b76 (patch)
treef2a00763fe3edead63c1e6adcce4417a2c0ba359 /newlib/libc/stdlib
parenteb5c631ead537ac5640d7e4b1ea0edbef344d6d9 (diff)
Implement sysconf for Arm
- add support for using sysconf to get page size in _mallocr.c via HAVE_SYSCONF_PAGESIZE flag set in configure.host - set flag in configure.host for arm and add a default sysconf implementation in libc/sys/arm that returns the page size - the default implementation can be overridden outside newlib to allow a different page size to improve malloc on devices with a small footprint without needing to rebuild newlib - this patch is based on a contribution from Torbjorn Svensson and Niklas Dahlquist (https://ecos.sourceware.org/ml/newlib/current/017616.html)
Diffstat (limited to 'newlib/libc/stdlib')
-rw-r--r--newlib/libc/stdlib/_mallocr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/newlib/libc/stdlib/_mallocr.c b/newlib/libc/stdlib/_mallocr.c
index 4b53997a3..1997b6db1 100644
--- a/newlib/libc/stdlib/_mallocr.c
+++ b/newlib/libc/stdlib/_mallocr.c
@@ -320,12 +320,14 @@ extern "C" {
#endif
#ifndef _WIN32
+#ifndef HAVE_SYSCONF_PAGESIZE
#ifdef SMALL_MEMORY
#define malloc_getpagesize (128)
#else
#define malloc_getpagesize (4096)
#endif
#endif
+#endif
#if __STD_C
extern void __malloc_lock(struct _reent *);