The AllocatorRingBuffer is allocated dynamically when Allocator is
initialized. This patch adds a corresponding deinitialization call in
unmapTestOnly, to avoid running out of virtual memory if the tests are run
a large number of times on memory-constrained platforms.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Can you provide a more complete summary of the problem, and how this addresses it? If there is an tracking issue on github, it's fine to keep the summary terse if the bug covers it in more detail, but this probably needs more context for anyone coming along later to understand why this is required, and the problem you're trying to solve.
compiler-rt/lib/scudo/standalone/combined.h | ||
---|---|---|
1530 | fly-by-comment: you may want to rename the initialization function something like mapAndInitialzeRingBuffer and this to unmapRingBuffer, since 1) that more closely matches what's going on, and 2) the relationship is obvious from the naming. alternatively using allocate/deallocate instead of map is equally good. |
compiler-rt/lib/scudo/standalone/combined.h | ||
---|---|---|
1519–1520 | BTW, I think this roundUp() is something we want to fix as well. Just add a note here. |
compiler-rt/lib/scudo/standalone/combined.h | ||
---|---|---|
1532 | Why not call getRingBufferSize()? |
compiler-rt/lib/scudo/standalone/combined.h | ||
---|---|---|
1532 | Oh I forgot we have this. |
BTW, I think this roundUp() is something we want to fix as well. Just add a note here.