summaryrefslogtreecommitdiff
path: root/runtime/gc/allocator/dlmalloc.cc
diff options
context:
space:
mode:
author Andreas Gampe <agampe@google.com> 2016-09-13 10:47:28 -0700
committer Andreas Gampe <agampe@google.com> 2016-09-26 10:59:22 -0700
commit3fec9ac0d5af1358d216eb2fdc2000ec0205f3f0 (patch)
treef38d8d8aae51f53e7ee6b474f47597b784fc2316 /runtime/gc/allocator/dlmalloc.cc
parent0cfe19af3b7395658210ea6044a65c9811962a7a (diff)
ART: Use libbase logging
Move most of our logging infrastructure over to system/core/base. Retain VLOG. Using unified Android infrastructure has two main advantages. First, it reduces the complexity/maintenance burden in ART. Second, it allows to detach logging for the cases where we do not want or need a runtime, e.g., dexdump, the disassembler, etc. As a part of the latter, libbase is also supported for all hosts (including Windows). From a developer viewpoint, there are minor behavior changes for the LOG statements (see above), but otherwise usage is the same. Explicit severity enum items are in the android::base namespace now. Bug: 31338270 Test: m test-art-host Change-Id: I5abcb2f45f5b03d49951874c48544f72a283a91b
Diffstat (limited to 'runtime/gc/allocator/dlmalloc.cc')
-rw-r--r--runtime/gc/allocator/dlmalloc.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/runtime/gc/allocator/dlmalloc.cc b/runtime/gc/allocator/dlmalloc.cc
index dc4e31253f..0c84224fcb 100644
--- a/runtime/gc/allocator/dlmalloc.cc
+++ b/runtime/gc/allocator/dlmalloc.cc
@@ -37,6 +37,9 @@ static void art_heap_usage_error(const char* function, void* p);
#pragma GCC diagnostic ignored "-Wempty-body"
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
#include "../../../external/dlmalloc/malloc.c"
+// Note: malloc.c uses a DEBUG define to drive debug code. This interferes with the DEBUG severity
+// of libbase, so undefine it now.
+#undef DEBUG
#pragma GCC diagnostic pop
static void* art_heap_morecore(void* m, intptr_t increment) {
@@ -44,11 +47,11 @@ static void* art_heap_morecore(void* m, intptr_t increment) {
}
static void art_heap_corruption(const char* function) {
- LOG(::art::FATAL) << "Corrupt heap detected in: " << function;
+ LOG(FATAL) << "Corrupt heap detected in: " << function;
}
static void art_heap_usage_error(const char* function, void* p) {
- LOG(::art::FATAL) << "Incorrect use of function '" << function << "' argument " << p
+ LOG(FATAL) << "Incorrect use of function '" << function << "' argument " << p
<< " not expected";
}
@@ -69,7 +72,7 @@ extern "C" void DlmallocMadviseCallback(void* start, void* end, size_t used_byte
int rc = madvise(start, length, MADV_DONTNEED);
if (UNLIKELY(rc != 0)) {
errno = rc;
- PLOG(::art::FATAL) << "madvise failed during heap trimming";
+ PLOG(FATAL) << "madvise failed during heap trimming";
}
size_t* reclaimed = reinterpret_cast<size_t*>(arg);
*reclaimed += length;