[Lldb-commits] [lldb] [lldb] Memory cache: no overlap and read across cache entries (PR #222688)

Felipe de Azevedo Piovezan via lldb-commits lldb-commits at lists.llvm.org
Fri Sep 11 06:35:59 PDT 2026


================
@@ -12,12 +12,97 @@
 #include "lldb/Utility/RangeMap.h"
 #include "lldb/lldb-private.h"
 #include "llvm/ADT/ArrayRef.h"
+#include "llvm/ADT/DenseMap.h"
 #include "llvm/ADT/SmallVector.h"
 #include <map>
+#include <memory>
 #include <mutex>
 #include <vector>
 
 namespace lldb_private {
+
+/// A set of whole, aligned cache lines, keyed by line index.  A key names a
+/// whole line, so no entry can be partial or unaligned and no length is
+/// stored per entry.
----------------
felipepiovezan wrote:

>  no length is stored per entry.

If we look close enough, that's not exactly true! `unique_ptr` needs to know how to free a `uint8_t[]`, so the size will be stored somewhere, even if deferred to the malloc/free implementation.

If we really want to avoid storing the size, this would need to be an `std::array`, which requires a compile-time size.

https://github.com/llvm/llvm-project/pull/222688


More information about the lldb-commits mailing list