summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/scudo/standalone/wrappers_c.h
Commit message (Collapse)AuthorAgeFilesLines
* [scudo][standalone] Introduce the C & C++ wrappers [fixed]Kostya Kortchinsky2019-06-271-0/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a redo of D63612. Two problems came up on some bots: - `__builtin_umull_overflow` was not declared. This is likely due to an older clang or gcc, so add a guard with `__has_builtin` and fallback to a division in the event the builtin doesn't exist; - contradicting definition for `malloc`, etc. This is AFAIU due to the fact that we ended up transitively including `stdlib.h` in the `.inc` due to it being the flags parser header: so move the include to the cc instead. This should fix the issues, but since those didn't come up in my local tests it's mostly guesswork. Rest is the same! Reviewers: morehouse, hctim, eugenis, vitalybuka, dyung, hans Reviewed By: morehouse, dyung, hans Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63831 llvm-svn: 364547
* Revert r364332 "[scudo][standalone] Introduce the C & C++ wrappers"Hans Wennborg2019-06-261-52/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes the build fail with e.g. llvm/projects/compiler-rt/lib/scudo/standalone/wrappers_c.inc:20:68: error: declaration of 'void* calloc(size_t, size_t)' has a different exception specifier INTERFACE WEAK void *SCUDO_PREFIX(calloc)(size_t nmemb, size_t size) { ^ See llvm-commits thread. > Summary: > This CL adds C & C++ wrappers and associated tests. Those use default > configurations for a Scudo combined allocator that will likely be > tweaked in the future. > > This is the final CL required to have a functional C & C++ allocator > based on Scudo. > > The structure I have chosen is to define the core C allocation > primitives in an `.inc` file that can be customized through defines. > This allows to easily have 2 (or more) sets of wrappers backed by > different combined allocators, as demonstrated by the `Bionic` > wrappers: one set for the "default" allocator, one set for the "svelte" > allocator. > > Currently all the tests added have been gtests, but I am planning to > add some more lit tests as well. > > Reviewers: morehouse, eugenis, vitalybuka, hctim, rengolin > > Reviewed By: morehouse > > Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits > > Tags: #llvm, #sanitizers > > Differential Revision: https://reviews.llvm.org/D63612 llvm-svn: 364400
* [scudo][standalone] Introduce the C & C++ wrappersKostya Kortchinsky2019-06-251-0/+52
Summary: This CL adds C & C++ wrappers and associated tests. Those use default configurations for a Scudo combined allocator that will likely be tweaked in the future. This is the final CL required to have a functional C & C++ allocator based on Scudo. The structure I have chosen is to define the core C allocation primitives in an `.inc` file that can be customized through defines. This allows to easily have 2 (or more) sets of wrappers backed by different combined allocators, as demonstrated by the `Bionic` wrappers: one set for the "default" allocator, one set for the "svelte" allocator. Currently all the tests added have been gtests, but I am planning to add some more lit tests as well. Reviewers: morehouse, eugenis, vitalybuka, hctim, rengolin Reviewed By: morehouse Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63612 llvm-svn: 364332
OpenPOWER on IntegriCloud