xref: /freebsd/contrib/llvm-project/compiler-rt/lib/msan/msan_allocator.h (revision 6be3386466ab79a84b48429ae66244f21526d3df)
1 //===-- msan_allocator.h ----------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file is a part of MemorySanitizer.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MSAN_ALLOCATOR_H
14 #define MSAN_ALLOCATOR_H
15 
16 #include "sanitizer_common/sanitizer_common.h"
17 
18 namespace __msan {
19 
20 struct MsanThreadLocalMallocStorage {
21   uptr quarantine_cache[16];
22   // Allocator cache contains atomic_uint64_t which must be 8-byte aligned.
23   ALIGNED(8) uptr allocator_cache[96 * (512 * 8 + 16)];  // Opaque.
24   void CommitBack();
25 
26  private:
27   // These objects are allocated via mmap() and are zero-initialized.
28   MsanThreadLocalMallocStorage() {}
29 };
30 
31 } // namespace __msan
32 #endif // MSAN_ALLOCATOR_H
33