summaryrefslogtreecommitdiff
path: root/lib/scudo/scudo_allocator.h
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2017-01-20 18:32:18 +0000
committerKostya Kortchinsky <kostyak@google.com>2017-01-20 18:32:18 +0000
commit3c3e150467551cde5760652ccff0c46a3fdba3c0 (patch)
treeed18a8fb6851f8b05af68c047d9f5d3edbecb4cd /lib/scudo/scudo_allocator.h
parent212ca9be08d3d542f8929754e651d42a6138fc41 (diff)
[scudo] Replacing std::atomic with Sanitizer's atomics
Summary: In an effort to getting rid of dependencies to external libraries, we are replacing atomic PackedHeader use of std::atomic with Sanitizer's atomic_uint64_t, which allows us to avoid -latomic. Reviewers: kcc, phosek, alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D28864 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@292630 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/scudo/scudo_allocator.h')
-rw-r--r--lib/scudo/scudo_allocator.h4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/scudo/scudo_allocator.h b/lib/scudo/scudo_allocator.h
index b9fc82dc6..5f5225b36 100644
--- a/lib/scudo/scudo_allocator.h
+++ b/lib/scudo/scudo_allocator.h
@@ -22,8 +22,6 @@
# error "The Scudo hardened allocator is currently only supported on Linux."
#endif
-#include <atomic>
-
namespace __scudo {
enum AllocType : u8 {
@@ -58,7 +56,7 @@ struct UnpackedHeader {
u64 Salt : 8;
};
-typedef std::atomic<PackedHeader> AtomicPackedHeader;
+typedef atomic_uint64_t AtomicPackedHeader;
COMPILER_CHECK(sizeof(UnpackedHeader) == sizeof(PackedHeader));
// Minimum alignment of 8 bytes for 32-bit, 16 for 64-bit