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
Diff Detail
- Build Status
Buildable 1695 Build 1695: arc lint + arc unit
Event Timeline
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 | ||
---|---|---|
58–59 | Is this function still used? |
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 | ||
---|---|---|
58–59 | Yes, it is, tsan has a bit more elaborated logic and I decided not to touch it, at least in this patch. |
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?
Is this function still used?