Skip to content

Commit c036cb8

Browse files
smanna12yuxuanchen1997
authored andcommitted
Prevent copying of ArenaAllocator (#97935)
Summary: This patch removes copy constructor and assignment operator from ArenaAllocator class to prevent resource duplication and ensure it remains non-copyable as per design intent. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60251510
1 parent 7dc335e commit c036cb8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

llvm/include/llvm/Demangle/MicrosoftDemangle.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ class ArenaAllocator {
5454
}
5555
}
5656

57+
// Delete the copy constructor and the copy assignment operator.
58+
ArenaAllocator(const ArenaAllocator &) = delete;
59+
ArenaAllocator &operator=(const ArenaAllocator &) = delete;
60+
5761
char *allocUnalignedBuffer(size_t Size) {
5862
assert(Head && Head->Buf);
5963

0 commit comments

Comments
 (0)