[PATCH] D119784: [Symbolize] LRU cache binaries in llvm-symbolizer.
Daniel Thornburgh via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 23 11:05:28 PST 2022
mysterymath added a comment.
| >>! In D119784#3339036 <https://reviews.llvm.org/D119784#3339036>, @dblaikie wrote: |
|
> [...] possibly doing pruneCache in the recordAccess call instead of having a separate call outside in llvm-symbolizer.cpp? I guess that comes back to the point you made in the review that the invalidation has to be in the client because otherwise stuff will be invalidated out from underneath the client's use case.
Yeah, there is actually a safe way to do that, it's a bit hairier. You'd have pruneCache mark the cache as "safe to prune", then have the code that adds a new item to the cache run the prune if that flag were set. If anything was accessed in the mean time, it'd set the safe flag to false, since at that point a memory reference might escape out. I was thinking that setting the flag to false would be another thing you'd have to make sure to do right or else bugs, but now that you mention it, that could go in the recordAccess call.
That should be a backwards compatible change though, so I'm inclined to just whip up the `size() != 1` version and come back to this later.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D119784/new/
https://reviews.llvm.org/D119784
More information about the llvm-commits
mailing list