The current code was sometimes attempting to release huge chunks of
memory due to undesired RoundUp/RoundDown interaction when the requested
range is fully contained within one memory page.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
Nice.
I understand this is never a problem in practice, because the kernel would never release a region of size (uptr)(-4096).
lib/sanitizer_common/sanitizer_posix_libcdep.cc | ||
---|---|---|
59 ↗ | (On Diff #79645) | Is this function still used? |
Comment Actions
It is not _really_a problem, but making pontless call, the one we know is going to fail, is not a good idea to me.
lib/sanitizer_common/sanitizer_posix_libcdep.cc | ||
---|---|---|
59 ↗ | (On Diff #79645) | Yes, it is, tsan has a bit more elaborated logic and I decided not to touch it, at least in this patch. |
Comment Actions
I just don't like that now we have two functions doing the same thing, one takes (start, end) pointers, the other - (start, size), and the difference in function names (the word "Pages") has nothing to do with the difference in their behavior.
How about we add the rounding logic to ReleaseMemoryToOS() and remove it from the call sites?