summaryrefslogtreecommitdiffstats
path: root/runtime/gc
diff options
context:
space:
mode:
authorIan Rogers <irogers@google.com>2014-10-30 11:19:14 -0700
committerIan Rogers <irogers@google.com>2014-10-30 11:19:14 -0700
commit872dd8208f00c667af8d9e0fd07fdd0ada56d437 (patch)
tree2f69282f19c72ef157dad9fdc7b6c6daf8a1bf38 /runtime/gc
parentaf62cf99a1a4320157e1074c1e65c5fbb0320349 (diff)
downloadandroid_art-872dd8208f00c667af8d9e0fd07fdd0ada56d437.tar.gz
android_art-872dd8208f00c667af8d9e0fd07fdd0ada56d437.tar.bz2
android_art-872dd8208f00c667af8d9e0fd07fdd0ada56d437.zip
Tidy and reduce ART library dependencies on the host.
Move to shared rather than static libraries. Avoids capture of all static libraries library dependencies. Change-Id: I2be96e92dad4ed1842d76b044745f2a2e15372eb
Diffstat (limited to 'runtime/gc')
-rw-r--r--runtime/gc/allocator/dlmalloc.h2
-rw-r--r--runtime/gc/heap.cc3
2 files changed, 5 insertions, 0 deletions
diff --git a/runtime/gc/allocator/dlmalloc.h b/runtime/gc/allocator/dlmalloc.h
index c820b192b9..c7ecbc83ce 100644
--- a/runtime/gc/allocator/dlmalloc.h
+++ b/runtime/gc/allocator/dlmalloc.h
@@ -30,10 +30,12 @@
#include "../../bionic/libc/upstream-dlmalloc/malloc.h"
+#ifdef HAVE_ANDROID_OS
// Define dlmalloc routines from bionic that cannot be included directly because of redefining
// symbols from the include above.
extern "C" void dlmalloc_inspect_all(void(*handler)(void*, void *, size_t, void*), void* arg);
extern "C" int dlmalloc_trim(size_t);
+#endif
// Callback for dlmalloc_inspect_all or mspace_inspect_all that will madvise(2) unused
// pages back to the kernel.
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index c0008aac84..6730dfe309 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -1017,6 +1017,8 @@ void Heap::Trim() {
// We never move things in the native heap, so we can finish the GC at this point.
FinishGC(self, collector::kGcTypeNone);
size_t native_reclaimed = 0;
+
+#ifdef HAVE_ANDROID_OS
// Only trim the native heap if we don't care about pauses.
if (!CareAboutPauseTimes()) {
#if defined(USE_DLMALLOC)
@@ -1029,6 +1031,7 @@ void Heap::Trim() {
UNIMPLEMENTED(WARNING) << "Add trimming support";
#endif
}
+#endif // HAVE_ANDROID_OS
uint64_t end_ns = NanoTime();
VLOG(heap) << "Heap trim of managed (duration=" << PrettyDuration(gc_heap_end_ns - start_ns)
<< ", advised=" << PrettySize(managed_reclaimed) << ") and native (duration="