11fb612d0SJianzhou Zhao //===-- dfsan_allocator.h ---------------------------------------*- C++ -*-===// 21fb612d0SJianzhou Zhao // 31fb612d0SJianzhou Zhao // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 41fb612d0SJianzhou Zhao // See https://llvm.org/LICENSE.txt for license information. 51fb612d0SJianzhou Zhao // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 61fb612d0SJianzhou Zhao // 71fb612d0SJianzhou Zhao //===----------------------------------------------------------------------===// 81fb612d0SJianzhou Zhao // 91fb612d0SJianzhou Zhao // This file is a part of DataflowSanitizer. 101fb612d0SJianzhou Zhao // 111fb612d0SJianzhou Zhao //===----------------------------------------------------------------------===// 121fb612d0SJianzhou Zhao 131fb612d0SJianzhou Zhao #ifndef DFSAN_ALLOCATOR_H 141fb612d0SJianzhou Zhao #define DFSAN_ALLOCATOR_H 151fb612d0SJianzhou Zhao 161fb612d0SJianzhou Zhao #include "sanitizer_common/sanitizer_common.h" 171fb612d0SJianzhou Zhao 181fb612d0SJianzhou Zhao namespace __dfsan { 191fb612d0SJianzhou Zhao 201fb612d0SJianzhou Zhao struct DFsanThreadLocalMallocStorage { 21*ba66d60bSFangrui Song alignas(8) uptr allocator_cache[96 * (512 * 8 + 16)]; // Opaque. 221fb612d0SJianzhou Zhao void CommitBack(); 231fb612d0SJianzhou Zhao 241fb612d0SJianzhou Zhao private: 251fb612d0SJianzhou Zhao // These objects are allocated via mmap() and are zero-initialized. 261fb612d0SJianzhou Zhao DFsanThreadLocalMallocStorage() {} 271fb612d0SJianzhou Zhao }; 281fb612d0SJianzhou Zhao 291fb612d0SJianzhou Zhao } // namespace __dfsan 301fb612d0SJianzhou Zhao #endif // DFSAN_ALLOCATOR_H 31