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