From fb8fd5076ea7ccc77960346e52b81134ccbb9ea3 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 12 Oct 2015 17:53:48 -0700 Subject: [PATCH] Opt Brillo out of the ndk cruft. Bug: http://b/24812426 Change-Id: I6a858d8ceebce9e2285e5b12de9fd89d2b42b352 --- libc/bionic/ndk_cruft.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp index b29968480..e7e20d12b 100644 --- a/libc/bionic/ndk_cruft.cpp +++ b/libc/bionic/ndk_cruft.cpp @@ -47,7 +47,10 @@ #include "private/libc_logging.h" -// The part is only for 32-bit targets. +// Brillo doesn't need to support any legacy cruft. +#if !defined(__BRILLO__) + +// Most of the cruft is only for 32-bit Android targets. #if !defined(__LP64__) // These were accidentally declared in because we stupidly used to inline @@ -375,20 +378,18 @@ extern "C" void endpwent() { } #if defined(USE_JEMALLOC) extern "C" void dlmalloc_inspect_all(void (*)(void*, void*, size_t, void*), void*) { } +extern "C" int dlmalloc_trim(size_t) { + return 0; +} #else extern "C" void dlmalloc_inspect_all_real(void (*)(void*, void*, size_t, void*), void*); extern "C" void dlmalloc_inspect_all(void (*handler)(void*, void*, size_t, void*), void* arg) { dlmalloc_inspect_all_real(handler, arg); } -#endif - -#if defined(USE_JEMALLOC) -extern "C" int dlmalloc_trim(size_t) { - return 0; -} -#else extern "C" int dlmalloc_trim_real(size_t); extern "C" int dlmalloc_trim(size_t pad) { return dlmalloc_trim_real(pad); } #endif + +#endif // !defined(__BRILLO__)