Split cache::retrieve() into separate functions. One that retrieves
the cached block and another that sets the header and MTE environment.
These were split so that the retrieve function could be more easily
changed in the future and so that the retrieve function had the sole
purpose of retrieving a CachedBlock.
Details
- Reviewers
Chia-hungDuan cferris - Commits
- rG4c6b8bb87b34: [scudo] seperate cache retrieval logic
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you add some comment in the commit message (and update the summary here) that saying why we want to do this split?
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
445–459 | Can we merge this two if (useMemoryTagging<Config>(Options))? |
Combined if statements in setHeader() and updated commit message to explain
why we separated Cache::retrieve().
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
442 | Should be CachedBlock &Entry to match the retrieve call and avoid copying the data structure. Unless that's what you wanted to do. |
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
442 | I just passed in a copy because nothing should be writing to the CachedBlock Entry here, setHeader() is only reading values. |
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
442 | But it's a good idea to avoid doing the copy. Since the entry is not used after this point, it would make more sense to avoid doing the copy and passing by reference. |
passed in CachedBlock by reference to setHeader() to avoid copying the CachedBlock structure
Can you run clang format on this? By looking deep into the logs, I did see an error about clang format failing.
Should be CachedBlock &Entry to match the retrieve call and avoid copying the data structure. Unless that's what you wanted to do.