This patch replicates the refactoring proposed in D3732.
Details
Diff Detail
- Repository
- rL LLVM
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 | ||
|---|---|---|
| 38 ↗ | (On Diff #11839) | This is weird you don't have (c >= 'A' && c <= 'F'), although these values are handled in ParseHex(). |
| 164 ↗ | (On Diff #11839) | I believe you can safely replace ReadHex with ParseHex here, and get rid of the former. |
| 169 ↗ | (On Diff #11839) | ... And replace this with ParseDecimal() for consistency. |
| lib/sanitizer_common/sanitizer_procmaps_linux.cc | ||
| 90 ↗ | (On Diff #11839) | 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 ↗ | (On Diff #11877) | 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 ↗ | (On Diff #11877) | please change it back to c - 'a' + 10 |
| 31 ↗ | (On Diff #11877) | and c - 'A' + 10 |
| 32 ↗ | (On Diff #11877) | remove the parens |