summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/scudo/standalone/common.h
Commit message (Collapse)AuthorAgeFilesLines
* scudo: Replace a couple of macros with their expansions.Peter Collingbourne2019-11-271-15/+15
| | | | | | | | | The macros INLINE and COMPILER_CHECK always expand to the same thing (inline and static_assert respectively). Both expansions are standards compliant C++ and are used consistently in the rest of LLVM, so let's improve consistency with the rest of LLVM by replacing them with the expansions. Differential Revision: https://reviews.llvm.org/D70793
* [scudo][standalone] Merge Spin & Blocking mutex into a Hybrid oneKostya Kortchinsky2019-07-111-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We ran into a problem on Fuchsia where yielding threads would never be deboosted, ultimately resulting in several threads spinning on the same TSD, and no possibility for another thread to be scheduled, dead-locking the process. While this was fixed in Zircon, this lead to discussions about if spinning without a break condition was a good decision, and settled on a new hybrid model that would spin for a while then block. Currently we are using a number of iterations for spinning that is mostly arbitrary (based on sanitizer_common values), but this can be tuned in the future. Since we are touching `common.h`, we also use this change as a vehicle for an Android optimization (the page size is fixed in Bionic, so use a fixed value too). Reviewers: morehouse, hctim, eugenis, dvyukov, vitalybuka Reviewed By: hctim Subscribers: srhines, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D64358 llvm-svn: 365790
* [scudo][standalone] Introduce the SizeClassMapKostya Kortchinsky2019-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: As with the sanitizer_common allocator, the SCM allows for efficient mapping between sizes and size-classes, table-free. It doesn't depart significantly from the original, except that we allow the use of size-class 0 for other purposes (as opposed to chunks of size 0). The Primary will use it to hold TransferBatches. Reviewers: vitalybuka, eugenis, hctim, morehouse Reviewed By: vitalybuka Subscribers: srhines, mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D61088 llvm-svn: 359199
* [scudo][standalone] Introduce the Secondary allocatorKostya Kortchinsky2019-04-241-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The Secondary allocator wraps the platform allocation primitives. It is meant to be used for larger sizes that the Primary can't fullfill, as it will be slower, and sizes are multiple of the system page size. This also changes some of the existing code, notably the opaque platform data being passed to the platform specific functions: we can shave a couple of syscalls on Fuchsia by storing additional data (this addresses a TODO). Reviewers: eugenis, vitalybuka, hctim, morehouse Reviewed By: morehouse Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60787 llvm-svn: 359097
* [scudo][standalone] Add a standalone vector classKostya Kortchinsky2019-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This CL adds a standalone vector class that will be used by the scoped strings when they land. We reimplement our own vector class because we can't use the std library one. It's mostly borrowed from the current sanitizer_common one, with LLVM code style changes. Additionnally a casing change in a function name that slipped through the previous review (the function isn't used yet). Reviewers: vitalybuka, eugenis, flowerhack, dmmoore415, mcgrathr, morehouse Reviewed By: vitalybuka Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58689 llvm-svn: 354999
* [scudo][standalone] Introduce platform specific code & mutexesKostya Kortchinsky2019-02-261-0/+171
Summary: This CL adds the platform specific code for Fuchsia, Linux & Android, as well as some tests related to those (more tests to come later). While some of it is pretty much a straight port of the existing scudo & sanitizer_common code, the memory mapping functions have been reworked a bit to fit the limited usage scenario that Scudo has for them. For Fuchsia, I can now track the Vmar/Vmo pair for memory mappings if there is an intent to grow or decommit some mapping (that will be useful for the Primary). Reviewers: eugenis, vitalybuka, mcgrathr, phosek, flowerhack, morehouse, dmmoore415 Reviewed By: vitalybuka, morehouse Subscribers: kcc, dvyukov, srhines, mgorny, delcypher, jfb, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58184 llvm-svn: 354895
OpenPOWER on IntegriCloud