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