Skip to content

Commit 6f05c1b

Browse files
committed
refactor: delete unused conditional_rewind_guard class
1 parent 715132c commit 6f05c1b

File tree

1 file changed

+0
-28
lines changed

1 file changed

+0
-28
lines changed

src/quick-lint-js/linked-bump-allocator.h

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -86,34 +86,6 @@ class linked_bump_allocator : public boost::container::pmr::memory_resource {
8686
rewind_state rewind_;
8787
};
8888

89-
// Calls allocator->rewind() when destructed iff rewind_on_destruct() was
90-
// called.
91-
class conditional_rewind_guard {
92-
public:
93-
explicit conditional_rewind_guard(linked_bump_allocator* allocator)
94-
: allocator_(allocator), rewind_(allocator->prepare_for_rewind()) {}
95-
96-
conditional_rewind_guard(const conditional_rewind_guard&) = delete;
97-
conditional_rewind_guard& operator=(const conditional_rewind_guard&) =
98-
delete;
99-
100-
conditional_rewind_guard(conditional_rewind_guard&&) = delete;
101-
conditional_rewind_guard& operator=(conditional_rewind_guard&&) = delete;
102-
103-
~conditional_rewind_guard() {
104-
if (this->should_rewind_) {
105-
this->allocator_->rewind(std::move(this->rewind_));
106-
}
107-
}
108-
109-
void rewind_on_destruct() { this->should_rewind_ = true; }
110-
111-
private:
112-
linked_bump_allocator* allocator_;
113-
rewind_state rewind_;
114-
bool should_rewind_ = false;
115-
};
116-
11789
rewind_state prepare_for_rewind() {
11890
return rewind_state{
11991
.chunk_ = this->chunk_,

0 commit comments

Comments
 (0)