aboutsummaryrefslogtreecommitdiff
path: root/libc/bionic/jemalloc_wrapper.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2014-07-10 12:34:23 -0700
committerElliott Hughes <enh@google.com>2014-07-10 12:34:23 -0700
commit91570ce987ef93f9ba2fa663a5fee1bd2525a2ba (patch)
tree6d79ac1618f8415982041faf046378f8b684a12e /libc/bionic/jemalloc_wrapper.cpp
parentf0f8cd1ff3e7f7124cab8a687370b51df4ec93de (diff)
Slim down static binaries by avoiding stdio.
It's okay for a program to choose to drag in stdio, but it's unfortunate if even the minimal "int main() { return 42; }" drags in stdio... This brings the minimal static binary on ARM down from 78KiB to 46KiB. Given that we don't have a separate -lpthread it's not obvious to me that we can shave this down any further. I'm not sure whether this is a worthwhile change for that reason. (And the fact that dynamic binaries, the usual case, are unaffected either way.) Change-Id: I02f91dcff37d14354314a30b72fed2563f431c88
Diffstat (limited to 'libc/bionic/jemalloc_wrapper.cpp')
-rw-r--r--libc/bionic/jemalloc_wrapper.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/bionic/jemalloc_wrapper.cpp b/libc/bionic/jemalloc_wrapper.cpp
index d1fe96056..e33d560a4 100644
--- a/libc/bionic/jemalloc_wrapper.cpp
+++ b/libc/bionic/jemalloc_wrapper.cpp
@@ -21,7 +21,7 @@
#include "private/bionic_macros.h"
void* je_pvalloc(size_t bytes) {
- size_t pagesize = sysconf(_SC_PAGESIZE);
+ size_t pagesize = getpagesize();
size_t size = BIONIC_ALIGN(bytes, pagesize);
if (size < bytes) {
return NULL;