diff options
author | Alexander Potapenko <glider@google.com> | 2012-09-12 09:38:51 +0000 |
---|---|---|
committer | Alexander Potapenko <glider@google.com> | 2012-09-12 09:38:51 +0000 |
commit | 814451909a84d80d3fa2b99415b43e776f1305cd (patch) | |
tree | 3d5fd910fcd32f6428bcb2f91ef07a87b91617c6 | |
parent | cac6aaab0d1a12eb6f86a1e27f535346190c718a (diff) | |
download | bcm5719-llvm-814451909a84d80d3fa2b99415b43e776f1305cd.tar.gz bcm5719-llvm-814451909a84d80d3fa2b99415b43e776f1305cd.zip |
Initial support for malloc_zone_statistics. All counters are set to zero now.
This is required to overcome a crash in mstats() (http://code.google.com/p/address-sanitizer/issues/detail?id=109)
llvm-svn: 163690
-rw-r--r-- | compiler-rt/lib/asan/asan_malloc_mac.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler-rt/lib/asan/asan_malloc_mac.cc b/compiler-rt/lib/asan/asan_malloc_mac.cc index 49e53c76495..ef7fce7327c 100644 --- a/compiler-rt/lib/asan/asan_malloc_mac.cc +++ b/compiler-rt/lib/asan/asan_malloc_mac.cc @@ -312,17 +312,13 @@ void mi_force_unlock(malloc_zone_t *zone) { asan_mz_force_unlock(); } -// This function is currently unused, and we build with -Werror. -#if 0 void mi_statistics(malloc_zone_t *zone, malloc_statistics_t *stats) { - // TODO(csilvers): figure out how to fill these out - // TODO(glider): port this from tcmalloc when ready. + // TODO(glider): fill these correctly. stats->blocks_in_use = 0; stats->size_in_use = 0; stats->max_size_in_use = 0; stats->size_allocated = 0; } -#endif #if defined(MAC_OS_X_VERSION_10_6) && \ MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6 @@ -364,6 +360,7 @@ void ReplaceSystemMalloc() { asan_introspection.log = &mi_log; asan_introspection.force_lock = &mi_force_lock; asan_introspection.force_unlock = &mi_force_unlock; + asan_introspection.statistics = &mi_statistics; internal_memset(&asan_zone, 0, sizeof(malloc_zone_t)); |