[Lldb-commits] [PATCH] D76805: Fix SourceManager::SourceFileCache insertion
Emre Kultursay via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Mon Mar 30 11:24:27 PDT 2020
emrekultursay added a comment.
In D76805#1949642 <https://reviews.llvm.org/D76805#1949642>, @labath wrote:
> Ok, that makes kind of sense, though I am left wondering if we really need this feature, given that we have survived so long without noticing it is missing...
>
> Am I understanding it correctly that without this patch, we would only cache the most recently accessed file (via `m_last_file_sp` member), and would always reload when switching to a new file?
Yes, without this patch, only the most recently accessed file is cached inside that member, and switching to a new file replaces that entry. I guess this was designed for optimizing the case where the user hits "next line" while staying in the same file. Yet, if a breakpoint on a different file is hit during that "next line" command, we trigger a reload (twice).
This patch will increase memory usage, as mapped source files will stay in the cache, and thus, never be unmapped. The increase will be and proportional to the size of source files loaded by LLDB on-demand.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D76805/new/
https://reviews.llvm.org/D76805
More information about the lldb-commits
mailing list