llvm-project/compiler-rt/test/scudo
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
..
CMakeLists.txt [scudo] Use the macro get_test_cc_for_arch for the tests 2016-12-23 18:40:47 +00:00
alignment.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
double-free.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
interface.cpp [scudo] Fix buildbot test error on ARM 2017-02-03 21:59:00 +00:00
lit.cfg [scudo] Fix standalone compiler-rt test breakage 2017-02-06 17:24:52 +00:00
lit.site.cfg.in [scudo] 32-bit and hardware agnostic support 2016-11-30 17:32:20 +00:00
malloc.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
memalign.cpp [scudo] Change aligned alloc functions to be more compliant & perf changes 2017-06-29 16:45:20 +00:00
mismatch.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
options.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
overflow.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
preinit.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
quarantine.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
random_shuffle.cpp [scudo] Enabling MIPS support for Scudo 2017-06-19 11:28:59 +00:00
realloc.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
secondary.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
sized-delete.cpp [scudo] 32-bit quarantine sizes adjustments and bug fixes 2017-02-03 20:49:42 +00:00
sizes.cpp [Sanitizers] Operator new() interceptors always die on allocation error 2017-06-28 21:58:57 +00:00
threads.cpp [scudo] Add test exercising pthreads 2017-03-23 19:21:10 +00:00