forked from OSchip/llvm-project
Don't initialize interceptor_metadata_map unless SI_POSIX is set
Differential revision: https://reviews.llvm.org/D64794 llvm-svn: 367188
This commit is contained in:
parent
e7bea9b73a
commit
45d910de99
|
@ -317,11 +317,11 @@ struct CommonInterceptorMetadata {
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#if SI_POSIX
|
||||||
typedef AddrHashMap<CommonInterceptorMetadata, 31051> MetadataHashMap;
|
typedef AddrHashMap<CommonInterceptorMetadata, 31051> MetadataHashMap;
|
||||||
|
|
||||||
static MetadataHashMap *interceptor_metadata_map;
|
static MetadataHashMap *interceptor_metadata_map;
|
||||||
|
|
||||||
#if SI_POSIX
|
|
||||||
UNUSED static void SetInterceptorMetadata(__sanitizer_FILE *addr,
|
UNUSED static void SetInterceptorMetadata(__sanitizer_FILE *addr,
|
||||||
const FileMetadata &file) {
|
const FileMetadata &file) {
|
||||||
MetadataHashMap::Handle h(interceptor_metadata_map, (uptr)addr);
|
MetadataHashMap::Handle h(interceptor_metadata_map, (uptr)addr);
|
||||||
|
@ -9551,9 +9551,11 @@ INTERCEPTOR(void, sl_free, void *sl, int freeall) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static void InitializeCommonInterceptors() {
|
static void InitializeCommonInterceptors() {
|
||||||
|
#if SI_POSIX
|
||||||
static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1];
|
static u64 metadata_mem[sizeof(MetadataHashMap) / sizeof(u64) + 1];
|
||||||
interceptor_metadata_map =
|
interceptor_metadata_map =
|
||||||
new ((void *)&metadata_mem) MetadataHashMap(); // NOLINT
|
new ((void *)&metadata_mem) MetadataHashMap(); // NOLINT
|
||||||
|
#endif
|
||||||
|
|
||||||
INIT_MMAP;
|
INIT_MMAP;
|
||||||
INIT_MMAP64;
|
INIT_MMAP64;
|
||||||
|
|
Loading…
Reference in New Issue