changed cache retrieve algorithm to an "optimal-fit" which immediate
returns blocks that are less than 110% of the requested size. This
reduces memory waste while still allowing for an early return without
traversing the entire array of cached blocks
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
A minor comment nit.
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
312 | I think you lost the small description about how you did experiments to figure out the max allowed waste. |
added reasoning behind MaxAllowedWastedBytes variable and how I came up with that number
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
303 | I may name this as HeaderPos and rename another as EntryHeaderPos or CachedBlockHeaderPos | |
306 | It seems to me that this value may impact the optimal-parameter as well. Do you know what the range of Diff from your experiments is? | |
315 | Per discussion, how about fragmented? | |
316 | Declare this as constexpr at the prologue of this function and move the above comment there. |
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
306 | Should I get rid of this check? I'm pretty sure all of my 'Diff' calculations will be less than 16K right now because of the check |
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
313 | Maybe you want to update the comment here (not just the 10%) and attach some comment to FragmentedBytesDivisor |
compiler-rt/lib/scudo/standalone/secondary.h | ||
---|---|---|
306 | will deal with this in later cl |
I may name this as HeaderPos and rename another as EntryHeaderPos or CachedBlockHeaderPos