[compiler-rt] e79c3b4 - scudo: Fix Android build.
Peter Collingbourne via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 10 17:01:39 PST 2020
Author: Peter Collingbourne
Date: 2020-02-10T17:01:10-08:00
New Revision: e79c3b4c2d22256d8e66b6a908268e83bc8c4634
URL: https://github.com/llvm/llvm-project/commit/e79c3b4c2d22256d8e66b6a908268e83bc8c4634
DIFF: https://github.com/llvm/llvm-project/commit/e79c3b4c2d22256d8e66b6a908268e83bc8c4634.diff
LOG: scudo: Fix Android build.
Differential Revision: https://reviews.llvm.org/D74366
Added:
Modified:
compiler-rt/lib/scudo/standalone/wrappers_c.inc
Removed:
################################################################################
diff --git a/compiler-rt/lib/scudo/standalone/wrappers_c.inc b/compiler-rt/lib/scudo/standalone/wrappers_c.inc
index 5721b016014a..91f615dcb8f8 100644
--- a/compiler-rt/lib/scudo/standalone/wrappers_c.inc
+++ b/compiler-rt/lib/scudo/standalone/wrappers_c.inc
@@ -182,8 +182,8 @@ INTERFACE WEAK void *SCUDO_PREFIX(aligned_alloc)(size_t alignment,
INTERFACE WEAK int SCUDO_PREFIX(malloc_info)(UNUSED int options, FILE *stream) {
const scudo::uptr max_size =
decltype(SCUDO_ALLOCATOR)::PrimaryT::SizeClassMap::MaxSize;
- auto *sizes =
- static_cast<scudo::uptr *>(calloc(max_size, sizeof(scudo::uptr)));
+ auto *sizes = static_cast<scudo::uptr *>(
+ SCUDO_PREFIX(calloc)(max_size, sizeof(scudo::uptr)));
auto callback = [](uintptr_t, size_t size, void* arg) {
auto *sizes = reinterpret_cast<scudo::uptr *>(arg);
if (size < max_size)
@@ -196,7 +196,7 @@ INTERFACE WEAK int SCUDO_PREFIX(malloc_info)(UNUSED int options, FILE *stream) {
if (sizes[i])
fprintf(stream, "<alloc size=\"%lu\" count=\"%lu\"/>\n", i, sizes[i]);
fputs("</malloc>\n", stream);
- free(sizes);
+ SCUDO_PREFIX(free)(sizes);
return 0;
}
More information about the llvm-commits
mailing list