aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-16 18:12:51 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-16 18:12:51 +0100
commitccd468e576a96599cee5407a6c7d037f3edef9c1 (patch)
treeb93b4f900f6119e359b3ec70f80ce87628568850 /src
parentfix issue #6 on github (diff)
downloadslibc-ccd468e576a96599cee5407a6c7d037f3edef9c1.tar.gz
slibc-ccd468e576a96599cee5407a6c7d037f3edef9c1.tar.bz2
slibc-ccd468e576a96599cee5407a6c7d037f3edef9c1.tar.xz
the pagesize shall be retrieved in crt0 to avoid an unnecessary branching in calls to malloc-functions
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src')
-rw-r--r--src/malloc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/malloc.c b/src/malloc.c
index 1a0913c..21de34f 100644
--- a/src/malloc.c
+++ b/src/malloc.c
@@ -51,6 +51,7 @@ static size_t get_pagesize(void)
static size_t pagesize = 0;
if (pagesize == 0)
{
+ /* TODO This should be done i crt0. */
long r = sysconf(_SC_PAGESIZE);
pagesize = (size_t)(r == -1 ? 4096 : r);
}