<p dir="ltr">Any preference of map over unordered_map</p>
<div class="gmail_quote">On Nov 22, 2015 1:28 PM, "Keno Fischer via llvm-commits" <<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">loladiro created this revision.<br>
loladiro added a reviewer: lhames.<br>
loladiro added a subscriber: llvm-commits.<br>
loladiro set the repository for this revision to rL LLVM.<br>
<br>
DenseMap is most applicable when both keys and values are small. In this case, the value violates that assumption, causing quite significant memory overhead. A std::map is more appropriate in this case (or at least fixed the memory problems I was seeing).<br>
<br>
Repository:<br>
  rL LLVM<br>
<br>
<a href="http://reviews.llvm.org/D14910" rel="noreferrer" target="_blank">http://reviews.llvm.org/D14910</a><br>
<br>
Files:<br>
  lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp<br>
  lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h<br>
<br>
Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h<br>
===================================================================<br>
--- lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h<br>
+++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h<br>
@@ -226,7 +226,7 @@<br>
   // Relocations to sections already loaded. Indexed by SectionID which is the<br>
   // source of the address. The target where the address will be written is<br>
   // SectionID/Offset in the relocation itself.<br>
-  DenseMap<unsigned, RelocationList> Relocations;<br>
+  std::map<unsigned, RelocationList> Relocations;<br>
<br>
   // Relocations to external symbols that are not yet resolved.  Symbols are<br>
   // external when they aren't found in the global symbol table of all loaded<br>
Index: lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp<br>
===================================================================<br>
--- lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp<br>
+++ lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp<br>
@@ -96,11 +96,11 @@<br>
     // The Section here (Sections[i]) refers to the section in which the<br>
     // symbol for the relocation is located.  The SectionID in the relocation<br>
     // entry provides the section to which the relocation will be applied.<br>
-    int Idx = it->getFirst();<br>
+    int Idx = it->first;<br>
     uint64_t Addr = Sections[Idx].LoadAddress;<br>
     DEBUG(dbgs() << "Resolving relocations Section #" << Idx << "\t"<br>
                  << format("%p", (uintptr_t)Addr) << "\n");<br>
-    resolveRelocationList(it->getSecond(), Addr);<br>
+    resolveRelocationList(it->second, Addr);<br>
   }<br>
   Relocations.clear();<br>
<br>
<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div>