llvm-project/compiler-rt/lib
Kostya Kortchinsky 0ce4999002 [scudo] Change aligned alloc functions to be more compliant & perf changes
Summary:
We were not following the `man` documented behaviors for invalid arguments to
`memalign` and associated functions. Using `CHECK` for those was a bit extreme,
so we relax the behavior to return null pointers as expected when this happens.
Adapt the associated test.

I am using this change also to change a few more minor performance improvements:
- mark as `UNLIKELY` a bunch of unlikely conditions;
- the current `CHECK` in `__sanitizer::RoundUpTo` is redundant for us in *all*
  calls. So I am introducing our own version without said `CHECK`.
- change our combined allocator `GetActuallyAllocatedSize`. We already know if
  the pointer is from the Primary or Secondary, so the `PointerIsMine` check is
  redundant as well, and costly for the 32-bit Primary. So we get the size by
  directly using the available Primary functions.

Finally, change a `int` to `uptr` to avoid a warning/error when compiling on
Android.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 306698
2017-06-29 16:45:20 +00:00
..
BlocksRuntime
asan [Sanitizers] Operator new() interceptors always die on allocation error 2017-06-28 21:58:57 +00:00
builtins Add generic __bswap[ds]i2 implementations 2017-05-25 14:52:14 +00:00
cfi CFI: Add a blacklist entry for std::_Sp_counted_ptr_inplace::_Sp_counted_ptr_inplace(). 2017-05-05 18:46:14 +00:00
dfsan [sanitizer-coverage] remove stale code (old coverage); compiler-rt part 2017-05-31 18:26:32 +00:00
esan [asan] Recommit of r301904: Add strndup/__strndup interceptors 2017-05-11 08:53:24 +00:00
interception [WinASan] Fix hotpatching new Win 10 build 1703 x64 strnlen prologue 2017-06-16 20:44:00 +00:00
lsan Revert "[LSan] Make LSan allocator allocator_may_return_null compliant" 2017-06-29 04:39:17 +00:00
msan [Sanitizers] Operator new() interceptors always die on allocation error 2017-06-28 21:58:57 +00:00
profile [PGO] Reduce IO in profile dumping with merging 2017-06-28 16:46:06 +00:00
safestack [compiler-rt] Do not introduce __sanitizer namespace globally 2016-09-15 21:02:18 +00:00
sanitizer_common [Sanitizers] Operator new() interceptors always die on allocation error 2017-06-28 21:58:57 +00:00
scudo [scudo] Change aligned alloc functions to be more compliant & perf changes 2017-06-29 16:45:20 +00:00
stats Revert "[sancov] moving sancov rt to sancov/ directory" 2017-01-12 01:37:35 +00:00
tsan [Sanitizers] Operator new() interceptors always die on allocation error 2017-06-28 21:58:57 +00:00
ubsan [ubsan] Improve diagnostics for return value checks (compiler-rt) 2017-06-23 21:32:48 +00:00
xray [XRay][compiler-rt][NFC] Add example always/never instrument files. 2017-06-28 04:44:36 +00:00
CMakeLists.txt Don't build tsan/dd when COMPILER_RT_HAS_TSAN is false 2017-06-27 21:10:46 +00:00