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