1*d89ec533Spatrick //===-- dfsan_allocator.h ---------------------------------------*- C++ -*-===// 2*d89ec533Spatrick // 3*d89ec533Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4*d89ec533Spatrick // See https://llvm.org/LICENSE.txt for license information. 5*d89ec533Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6*d89ec533Spatrick // 7*d89ec533Spatrick //===----------------------------------------------------------------------===// 8*d89ec533Spatrick // 9*d89ec533Spatrick // This file is a part of DataflowSanitizer. 10*d89ec533Spatrick // 11*d89ec533Spatrick //===----------------------------------------------------------------------===// 12*d89ec533Spatrick 13*d89ec533Spatrick #ifndef DFSAN_ALLOCATOR_H 14*d89ec533Spatrick #define DFSAN_ALLOCATOR_H 15*d89ec533Spatrick 16*d89ec533Spatrick #include "sanitizer_common/sanitizer_common.h" 17*d89ec533Spatrick 18*d89ec533Spatrick namespace __dfsan { 19*d89ec533Spatrick 20*d89ec533Spatrick struct DFsanThreadLocalMallocStorage { 21*d89ec533Spatrick ALIGNED(8) uptr allocator_cache[96 * (512 * 8 + 16)]; // Opaque. 22*d89ec533Spatrick void CommitBack(); 23*d89ec533Spatrick 24*d89ec533Spatrick private: 25*d89ec533Spatrick // These objects are allocated via mmap() and are zero-initialized. DFsanThreadLocalMallocStorageDFsanThreadLocalMallocStorage26*d89ec533Spatrick DFsanThreadLocalMallocStorage() {} 27*d89ec533Spatrick }; 28*d89ec533Spatrick 29*d89ec533Spatrick } // namespace __dfsan 30*d89ec533Spatrick #endif // DFSAN_ALLOCATOR_H 31