diff options
author | Dan Liew <dan@su-root.co.uk> | 2018-12-06 12:39:00 +0000 |
---|---|---|
committer | Dan Liew <dan@su-root.co.uk> | 2018-12-06 12:39:00 +0000 |
commit | 0522a163ae9a44c739bd010e20be98c8d05e4395 (patch) | |
tree | 0a7344cc8d82b3f8923bf50deb2bc9216af50f13 /lib/sanitizer_common/sanitizer_malloc_mac.inc | |
parent | 099ae47a4b73b35430c0b245fe286776c0ce151a (diff) | |
download | compiler-rt-0522a163ae9a44c739bd010e20be98c8d05e4395.tar.gz |
Add new `__sanitizer_mz_default_zone()` API which returns the address of the ASan malloc zone. This API will be used for testing in future patches.
Summary:
The name of the function is based on `malloc_default_zone()` found
in Darwin's `malloc/malloc.h` header file.
Reviewers: kubamracek, george.karpenkov
Subscribers: #sanitizers, llvm-commits
Differential Revision: https://reviews.llvm.org/D55064
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@348481 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_malloc_mac.inc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_malloc_mac.inc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_malloc_mac.inc b/lib/sanitizer_common/sanitizer_malloc_mac.inc index 22e81d4a9..44c914cea 100644 --- a/lib/sanitizer_common/sanitizer_malloc_mac.inc +++ b/lib/sanitizer_common/sanitizer_malloc_mac.inc @@ -265,6 +265,13 @@ void *__sanitizer_mz_memalign(malloc_zone_t *zone, size_t align, size_t size) { return p; } +// This public API exists purely for testing purposes. +extern "C" +SANITIZER_INTERFACE_ATTRIBUTE +malloc_zone_t* __sanitizer_mz_default_zone() { + return &sanitizer_zone; +} + // This function is currently unused, and we build with -Werror. #if 0 void __sanitizer_mz_free_definite_size( |