llvm-project/compiler-rt/lib/scudo
Kostya Kortchinsky efe3d3436a [scudo] Refactor ScudoChunk
Summary:
The initial implementation used an ASan like Chunk class that was deriving from
a Header class. Due to potential races, we ended up working with local copies
of the Header and never using the parent class fields. ScudoChunk was never
constructed but cast, and we were using `this` as the pointer needed for our
computations. This was meh.

So we refactored ScudoChunk to be now a series of static functions within the
namespace `__scudo::Chunk` that take a "user" pointer as first parameter (former
`this`). A compiled binary doesn't really change, but the code is more sensible.

Clang tends to inline all those small function (in -O2), but GCC left a few not
inlined, so we add the `INLINE` keyword to all.

Since we don't have `ScudoChunk` pointers anymore, a few variables were renamed
here and there to introduce a clearer distinction between a user pointer
(usually `Ptr`) and a backend pointer (`BackendPtr`).

Reviewers: alekseyshl, flowerhack

Reviewed By: alekseyshl

Subscribers: #sanitizers, llvm-commits

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

llvm-svn: 320745
2017-12-14 21:32:57 +00:00
..
CMakeLists.txt [scudo] Implement stricter separation of C vs C++ 2017-11-01 15:28:20 +00:00
scudo_allocator.cpp [scudo] Refactor ScudoChunk 2017-12-14 21:32:57 +00:00
scudo_allocator.h [scudo] Get rid of the thread local PRNG & header salt 2017-12-05 17:08:29 +00:00
scudo_allocator_combined.h [scudo] Get rid of the thread local PRNG & header salt 2017-12-05 17:08:29 +00:00
scudo_allocator_secondary.h [scudo] Correct performance regression in Secondary 2017-12-06 16:53:24 +00:00
scudo_crc32.cpp [scudo] CRC32 optimizations 2017-05-09 15:12:38 +00:00
scudo_crc32.h [sanitizer] Add Scudo to the sanitizer lint checks. 2017-11-08 16:42:29 +00:00
scudo_flags.cpp [scudo] Simplify initialization and flags 2017-11-14 16:14:53 +00:00
scudo_flags.h [scudo] 32-bit and hardware agnostic support 2016-11-30 17:32:20 +00:00
scudo_flags.inc [scudo] Quarantine overhaul 2017-07-24 15:29:38 +00:00
scudo_interceptors.cpp [scudo] 32-bit and hardware agnostic support 2016-11-30 17:32:20 +00:00
scudo_interface_internal.h [scudo] Adding a public Scudo interface 2017-12-13 20:41:35 +00:00
scudo_new_delete.cpp [scudo] Application & platform compatibility changes 2017-08-16 16:40:48 +00:00
scudo_platform.h [scudo] Adding a public Scudo interface 2017-12-13 20:41:35 +00:00
scudo_termination.cpp [scudo] 32-bit and hardware agnostic support 2016-11-30 17:32:20 +00:00
scudo_tsd.h [sanitizer] Introduce a vDSO aware timing function 2017-12-13 16:23:54 +00:00
scudo_tsd_exclusive.cpp [scudo] Allow for non-Android Shared TSD platforms, part 1 2017-10-12 15:01:09 +00:00
scudo_tsd_exclusive.inc [scudo] Scudo thread specific data refactor, part 3 2017-09-26 17:20:02 +00:00
scudo_tsd_shared.cpp [scudo] Make getNumberOfCPUs Fuchsia compliant v2 2017-11-21 21:14:00 +00:00
scudo_tsd_shared.inc [scudo] Allow for non-Android Shared TSD platforms, part 2 2017-10-13 20:55:31 +00:00
scudo_utils.cpp [scudo] Workaround for uninitialized Bionic globals 2017-11-27 21:34:43 +00:00
scudo_utils.h [scudo] Minor code generation improvement 2017-12-08 16:36:37 +00:00