[sanitizer] Fix Darwin build

llvm-svn: 328417
This commit is contained in:
Vitaly Buka 2018-03-24 08:13:18 +00:00
parent 097b47a0fc
commit f791c9659b
2 changed files with 7 additions and 3 deletions

View File

@ -344,9 +344,9 @@ uptr GetPageSize() {
return sysconf(_SC_PAGESIZE);
}
extern unsigned malloc_num_zones;
extern malloc_zone_t **malloc_zones;
static malloc_zone_t sanitizer_zone;
extern "C" unsigned malloc_num_zones;
extern "C" malloc_zone_t **malloc_zones;
malloc_zone_t sanitizer_zone;
// We need to make sure that sanitizer_zone is registered as malloc_zones[0]. If
// libmalloc tries to set up a different zone as malloc_zones[0], it will call

View File

@ -29,6 +29,10 @@
// Similar code is used in Google Perftools,
// https://github.com/gperftools/gperftools.
namespace __sanitizer {
extern malloc_zone_t sanitizer_zone;
}
INTERCEPTOR(malloc_zone_t *, malloc_create_zone,
vm_size_t start_size, unsigned zone_flags) {
COMMON_MALLOC_ENTER();