summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVedant Kumar <vsk@apple.com>2016-09-27 22:52:34 +0000
committerVedant Kumar <vsk@apple.com>2016-09-27 22:52:34 +0000
commitff17fcbc58975d80d8be2d1c9e5b0b2ef79ac5d3 (patch)
treebef86b920e8480bc978f2048f186442c1e7abb52
parent0013782030addbaa44c98316652406e76fd37769 (diff)
downloadbcm5719-llvm-ff17fcbc58975d80d8be2d1c9e5b0b2ef79ac5d3.tar.gz
bcm5719-llvm-ff17fcbc58975d80d8be2d1c9e5b0b2ef79ac5d3.zip
[sanitizer_common] Delete some copy/move methods in InternalScopedBuffer
Differential Revision: https://reviews.llvm.org/D24811 llvm-svn: 282548
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_common.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common.h b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
index d0b983ccf4b..2de93ebae47 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_common.h
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_common.h
@@ -115,16 +115,14 @@ void RunFreeHooks(const void *ptr);
// keep frame size low.
// FIXME: use InternalAlloc instead of MmapOrDie once
// InternalAlloc is made libc-free.
-template<typename T>
+template <typename T>
class InternalScopedBuffer {
public:
explicit InternalScopedBuffer(uptr cnt) {
cnt_ = cnt;
- ptr_ = (T*)MmapOrDie(cnt * sizeof(T), "InternalScopedBuffer");
- }
- ~InternalScopedBuffer() {
- UnmapOrDie(ptr_, cnt_ * sizeof(T));
+ ptr_ = (T *)MmapOrDie(cnt * sizeof(T), "InternalScopedBuffer");
}
+ ~InternalScopedBuffer() { UnmapOrDie(ptr_, cnt_ * sizeof(T)); }
T &operator[](uptr i) { return ptr_[i]; }
T *data() { return ptr_; }
uptr size() { return cnt_ * sizeof(T); }
@@ -132,9 +130,11 @@ class InternalScopedBuffer {
private:
T *ptr_;
uptr cnt_;
- // Disallow evil constructors.
- InternalScopedBuffer(const InternalScopedBuffer&);
- void operator=(const InternalScopedBuffer&);
+ // Disallow copies and moves.
+ InternalScopedBuffer(const InternalScopedBuffer &) = delete;
+ InternalScopedBuffer &operator=(const InternalScopedBuffer &) = delete;
+ InternalScopedBuffer(InternalScopedBuffer &&) = delete;
+ InternalScopedBuffer &operator=(InternalScopedBuffer &&) = delete;
};
class InternalScopedString : public InternalScopedBuffer<char> {
OpenPOWER on IntegriCloud