hanchenye-llvm-project/compiler-rt
Kostya Kortchinsky b44364dd15 [scudo] Do not grab a cache for secondary allocation & per related changes
Summary:
Secondary backed allocations do not require a cache. While it's not necessary
an issue when each thread has its cache, it becomes one with a shared pool of
caches (Android), as a Secondary backed allocation or deallocation holds a
cache that could be useful to another thread doing a Primary backed allocation.

We introduce an additional PRNG and its mutex (to avoid contention with the
Fallback one for Primary allocations) that will provide the `Salt` needed for
Secondary backed allocations.

I changed some of the code in a way that feels more readable to me (eg: using
some values directly rather than going  through ternary assigned variables,
using directly `true`/`false` rather than `FromPrimary`). I will let reviewers
decide if it actually is.

An additional change is to mark `CheckForCallocOverflow` as `UNLIKELY`.

Reviewers: alekseyshl

Reviewed By: alekseyshl

Subscribers: llvm-commits

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

llvm-svn: 307958
2017-07-13 21:01:19 +00:00
..
cmake On Darwin, start building the TSan iOS dylib by default. 2017-07-12 20:25:14 +00:00
docs
include [XRay][compiler-rt][NFC] Add a name for argument to __xray_set_handler_arg1(...) 2017-06-19 01:30:04 +00:00
lib [scudo] Do not grab a cache for secondary allocation & per related changes 2017-07-13 21:01:19 +00:00
test [ubsan] Teach the pointer overflow check that "p - <unsigned> <= p" (compiler-rt) 2017-07-13 20:55:41 +00:00
unittests Add missing import 2017-04-07 01:24:48 +00:00
www
.arcconfig
.gitignore
CMakeLists.txt Make sure SANITIZER_MIN_OSX_VERSION is defined before using it. 2017-07-07 22:40:13 +00:00
CODE_OWNERS.TXT
CREDITS.TXT
LICENSE.TXT
README.txt

README.txt

Compiler-RT
================================

This directory and its subdirectories contain source code for the compiler
support routines.

Compiler-RT is open source software. You may freely distribute it under the
terms of the license agreement found in LICENSE.txt.

================================