Skip to content

Commit 3706c12

Browse files
authored
Prevent copying of ArenaAllocator (#97935)
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.
1 parent 5b54f36 commit 3706c12

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Diff for: llvm/include/llvm/Demangle/MicrosoftDemangle.h

+4
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)