HomePhabricator

[XRay][compiler-rt] Update use of internal_mmap

Description

[XRay][compiler-rt] Update use of internal_mmap

Summary:
The implementation of internal_mmap(...) deviates from the contract of
mmap(...) -- i.e. error returns are actually the equivalent of errno
results. We update how XRay uses internal_mmap(...) to better handle
these error conditions.

In the process, we change the default pointers we're using from char*
to uint8_t* to prevent potential usage of the pointers in the string
library functions that expect to operate on char*.

We also take the chance to "promote" sizes of individual internal_mmap
requests to at least page size bytes, consistent with the expectations
of calls to mmap.

Reviewers: cryptoad, mboerger

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D52361

Details