Commit 5a776bc8 authored by Ng Zhi An's avatar Ng Zhi An Committed by Commit Bot

[clang-tidy] Make deleted constructor public

Making them private was a way to hide the constructor, we can
explicitly delete them, which give a better compilation error message as
well.

Also see: https://stackoverflow.com/q/55205874

Bug: v8:10488
Change-Id: I1c037a501c1da39f027c071e5e64d36fd1c95c6d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2219419Reviewed-by: 's avatarJakob Kummerow <jkummerow@chromium.org>
Commit-Queue: Zhi An Ng <zhin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68049}
parent 560a681f
...@@ -204,6 +204,10 @@ class HandleScope { ...@@ -204,6 +204,10 @@ class HandleScope {
return ::operator new(size, storage); return ::operator new(size, storage);
} }
// Prevent heap allocation or illegal handle scopes.
void* operator new(size_t size) = delete;
void operator delete(void* size_t) = delete;
inline ~HandleScope(); inline ~HandleScope();
inline HandleScope& operator=(HandleScope&& other) V8_NOEXCEPT; inline HandleScope& operator=(HandleScope&& other) V8_NOEXCEPT;
...@@ -239,10 +243,6 @@ class HandleScope { ...@@ -239,10 +243,6 @@ class HandleScope {
static const int kCheckHandleThreshold = 30 * 1024; static const int kCheckHandleThreshold = 30 * 1024;
private: private:
// Prevent heap allocation or illegal handle scopes.
void* operator new(size_t size) = delete;
void operator delete(void* size_t) = delete;
Isolate* isolate_; Isolate* isolate_;
Address* prev_next_; Address* prev_next_;
Address* prev_limit_; Address* prev_limit_;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment