This patch replicates the refactoring proposed in D3732.
Details
Diff Detail
Event Timeline
ReadHex() rewritten via ParseHex(); extra definitions for cached_proc_self_maps_ and cache_lock_ removed from the Linux-specific source file.
I think it's better to first remove ReadHex/ReadDecimal in favor of ParseHex/ParseDecimal in a small separate change, and then proceed with this change.
lib/sanitizer_common/sanitizer_procmaps_common.cc | ||
---|---|---|
39 | This is weird you don't have (c >= 'A' && c <= 'F'), although these values are handled in ParseHex(). | |
165 | I believe you can safely replace ReadHex with ParseHex here, and get rid of the former. | |
170 | ... And replace this with ParseDecimal() for consistency. | |
lib/sanitizer_common/sanitizer_procmaps_linux.cc | ||
90 | Fix comment near this #endif |
That is, it's fine to submit the small piece related to ReadHex/ReadDecimal w/o review.
LGTM modulo nits below.
lib/sanitizer_common/sanitizer_procmaps.h | ||
---|---|---|
90 | This function is implemented only on FreeBSD and Linux, but not on Mac. Put it near the ProcSelfMapsBuff definition above. | |
lib/sanitizer_common/sanitizer_procmaps_common.cc | ||
29 | please change it back to c - 'a' + 10 | |
31 | and c - 'A' + 10 | |
32 | remove the parens |
This function is implemented only on FreeBSD and Linux, but not on Mac. Put it near the ProcSelfMapsBuff definition above.