diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-04-04 09:47:41 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2014-04-04 09:47:41 +0000 |
commit | ba4ad34df1af1c321da0981e1aaff9d35c45d37f (patch) | |
tree | e1d8ac67bf297961c9cf31724f7709c2380d507c /lib/msan/msan_allocator.h | |
parent | 8dc0d7f875b37003ce805dfe04c88bee3f02a6b8 (diff) |
[msan] Introduce MsanThread. Move thread-local allocator cache out of TLS.
This reduces .tbss from 109K down to almost nothing.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205618 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/msan/msan_allocator.h')
-rw-r--r-- | lib/msan/msan_allocator.h | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/msan/msan_allocator.h b/lib/msan/msan_allocator.h new file mode 100644 index 000000000..407942e54 --- /dev/null +++ b/lib/msan/msan_allocator.h @@ -0,0 +1,33 @@ +//===-- msan_allocator.h ----------------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of MemorySanitizer. +// +//===----------------------------------------------------------------------===// + +#ifndef MSAN_ALLOCATOR_H +#define MSAN_ALLOCATOR_H + +#include "sanitizer_common/sanitizer_common.h" + +namespace __msan { + +struct MsanThreadLocalMallocStorage { + uptr quarantine_cache[16]; + // Allocator cache contains atomic_uint64_t which must be 8-byte aligned. + ALIGNED(8) uptr allocator_cache[96 * (512 * 8 + 16)]; // Opaque. + void CommitBack(); + + private: + // These objects are allocated via mmap() and are zero-initialized. + MsanThreadLocalMallocStorage() {} +}; + +} // namespace __msan +#endif // MSAN_ALLOCATOR_H |