diff options
author | Kostya Kortchinsky <kostyak@google.com> | 2019-10-04 15:46:34 +0000 |
---|---|---|
committer | Kostya Kortchinsky <kostyak@google.com> | 2019-10-04 15:46:34 +0000 |
commit | dc802dbef28429f8b7bfa0ad8dc43d8c6233e825 (patch) | |
tree | 6579d5f2f822f6f6612c69be52c522f79e94a10e /compiler-rt/lib/scudo/standalone/wrappers_c.inc | |
parent | 237d0af7a8b8b9b507f86846842a51657810b20d (diff) | |
download | bcm5719-llvm-dc802dbef28429f8b7bfa0ad8dc43d8c6233e825.tar.gz bcm5719-llvm-dc802dbef28429f8b7bfa0ad8dc43d8c6233e825.zip |
[scudo][standalone] Make malloc_info return a minimal XML
Summary:
Initially, our malloc_info was returning ENOTSUP, but Android would
rather have it return successfully and write a barebone XML to the
stream, so we will oblige.
Add an associated test.
Reviewers: cferris, morehouse, hctim, eugenis, vitalybuka
Reviewed By: morehouse
Subscribers: delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D68427
llvm-svn: 373754
Diffstat (limited to 'compiler-rt/lib/scudo/standalone/wrappers_c.inc')
-rw-r--r-- | compiler-rt/lib/scudo/standalone/wrappers_c.inc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler-rt/lib/scudo/standalone/wrappers_c.inc b/compiler-rt/lib/scudo/standalone/wrappers_c.inc index cb2202dcedf..a9adbc83588 100644 --- a/compiler-rt/lib/scudo/standalone/wrappers_c.inc +++ b/compiler-rt/lib/scudo/standalone/wrappers_c.inc @@ -179,7 +179,8 @@ INTERFACE WEAK void *SCUDO_PREFIX(aligned_alloc)(size_t alignment, SCUDO_ALLOCATOR.allocate(size, scudo::Chunk::Origin::Malloc, alignment)); } -INTERFACE WEAK int SCUDO_PREFIX(malloc_info)(int, FILE *) { - errno = ENOTSUP; - return -1; +INTERFACE WEAK int SCUDO_PREFIX(malloc_info)(UNUSED int options, FILE *stream) { + fputs("<malloc version=\"scudo-1\">", stream); + fputs("</malloc>", stream); + return 0; } |