1 //===-- msan_allocator.h ----------------------------------------*- C++ -*-===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is distributed under the University of Illinois Open Source 6 // License. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 // 10 // This file is a part of MemorySanitizer. 11 // 12 //===----------------------------------------------------------------------===// 13 14 #ifndef MSAN_ALLOCATOR_H 15 #define MSAN_ALLOCATOR_H 16 17 #include "sanitizer_common/sanitizer_common.h" 18 19 namespace __msan { 20 21 struct MsanThreadLocalMallocStorage { 22 uptr quarantine_cache[16]; 23 // Allocator cache contains atomic_uint64_t which must be 8-byte aligned. 24 ALIGNED(8) uptr allocator_cache[96 * (512 * 8 + 16)]; // Opaque. 25 void CommitBack(); 26 27 private: 28 // These objects are allocated via mmap() and are zero-initialized. MsanThreadLocalMallocStorageMsanThreadLocalMallocStorage29 MsanThreadLocalMallocStorage() {} 30 }; 31 32 } // namespace __msan 33 #endif // MSAN_ALLOCATOR_H 34