[PATCH] D121638: [lld-macho] Avoid using bump-alloc in TrieBuider
Vy Nguyen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 14 14:18:48 PDT 2022
oontvoo updated this revision to Diff 415223.
oontvoo added a comment.
removed explicit on dtor
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D121638/new/
https://reviews.llvm.org/D121638
Files:
lld/MachO/ExportTrie.cpp
lld/MachO/ExportTrie.h
Index: lld/MachO/ExportTrie.h
===================================================================
--- lld/MachO/ExportTrie.h
+++ lld/MachO/ExportTrie.h
@@ -22,6 +22,7 @@
class TrieBuilder {
public:
+ ~TrieBuilder();
void setImageBase(uint64_t addr) { imageBase = addr; }
void addSymbol(const Symbol &sym) { exported.push_back(&sym); }
// Returns the size in bytes of the serialized trie.
Index: lld/MachO/ExportTrie.cpp
===================================================================
--- lld/MachO/ExportTrie.cpp
+++ lld/MachO/ExportTrie.cpp
@@ -145,8 +145,13 @@
}
}
+TrieNode::~TrieNode() {
+ for (TrieNode *node : nodes)
+ delete node;
+}
+
TrieNode *TrieBuilder::makeNode() {
- auto *node = make<TrieNode>();
+ auto *node = new TrieNode();
nodes.emplace_back(node);
return node;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121638.415223.patch
Type: text/x-patch
Size: 822 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220314/b610a0be/attachment.bin>
More information about the llvm-commits
mailing list