diff options
| author | Dean Michael Berris <dberris@google.com> | 2018-09-21 16:34:42 +0000 |
|---|---|---|
| committer | Dean Michael Berris <dberris@google.com> | 2018-09-21 16:34:42 +0000 |
| commit | 0cb22386e08a754dae724f96fbc9e38273edafba (patch) | |
| tree | 63a93857743b17cbec855405dfd85855ddbbf1e8 /compiler-rt/lib/xray/xray_buffer_queue.h | |
| parent | f8ecb22dcb2c8efdfcd351940a842469f339dedc (diff) | |
| download | bcm5719-llvm-0cb22386e08a754dae724f96fbc9e38273edafba.tar.gz bcm5719-llvm-0cb22386e08a754dae724f96fbc9e38273edafba.zip | |
[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
llvm-svn: 342745
Diffstat (limited to 'compiler-rt/lib/xray/xray_buffer_queue.h')
| -rw-r--r-- | compiler-rt/lib/xray/xray_buffer_queue.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/xray/xray_buffer_queue.h b/compiler-rt/lib/xray/xray_buffer_queue.h index bfb091e3f83..c1fa9fab768 100644 --- a/compiler-rt/lib/xray/xray_buffer_queue.h +++ b/compiler-rt/lib/xray/xray_buffer_queue.h @@ -20,6 +20,7 @@ #include "sanitizer_common/sanitizer_mutex.h" #include "xray_defs.h" #include <cstddef> +#include <cstdint> namespace __xray { @@ -114,7 +115,7 @@ private: // A pointer to a contiguous block of memory to serve as the backing store for // all the individual buffers handed out. - void *BackingStore; + uint8_t *BackingStore; // A dynamically allocated array of BufferRep instances. BufferRep *Buffers; |

