summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/msan/msan_allocator.h
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-04-04 09:47:41 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2014-04-04 09:47:41 +0000
commitf653cda2695ac7390fe5663f2c0895213938334d (patch)
treeda990d2809926a89e640413fce986e07f30c28fd /compiler-rt/lib/msan/msan_allocator.h
parent9f20c9b17c7da2339efe03782943375063589080 (diff)
downloadbcm5719-llvm-f653cda2695ac7390fe5663f2c0895213938334d.tar.gz
bcm5719-llvm-f653cda2695ac7390fe5663f2c0895213938334d.zip
[msan] Introduce MsanThread. Move thread-local allocator cache out of TLS.
This reduces .tbss from 109K down to almost nothing. llvm-svn: 205618
Diffstat (limited to 'compiler-rt/lib/msan/msan_allocator.h')
-rw-r--r--compiler-rt/lib/msan/msan_allocator.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/compiler-rt/lib/msan/msan_allocator.h b/compiler-rt/lib/msan/msan_allocator.h
new file mode 100644
index 00000000000..407942e54c1
--- /dev/null
+++ b/compiler-rt/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
OpenPOWER on IntegriCloud