summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/scudo/scudo_malloc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* [sanitizer] Fix mallopt interceptor.Evgeniy Stepanov2018-10-251-1/+1
| | | | | | On error, mallopt is supposed to return 0, not -1. llvm-svn: 345323
* [scudo] Get rid of builtin-declaration-mismatch warningsKostya Kortchinsky2018-07-031-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The C interceptors were using `SIZE_T` defined in the interception library as a `__sanitizer::uptr`. On some 32-bit platforms, this lead to the following warning: ``` warning: declaration of ‘void* malloc(SIZE_T)’ conflicts with built-in declaration ‘void* malloc(unsigned int)’ [-Wbuiltin-declaration-mismatch] INTERCEPTOR_ATTRIBUTE void *malloc(SIZE_T size) { ``` `__sanitizer::uptr` is indeed defined as an `unsigned long` on those. So just include `stddef.h` and use `size_t` instead. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48885 llvm-svn: 336221
* [scudo] Add C++17 aligned new/delete operators supportKostya Kortchinsky2018-06-121-3/+3
| | | | | | | | | | | | | | | | | | | Summary: This CL adds support for aligned new/delete operators (C++17). Currently we do not support alignment inconsistency detection on deallocation, as this requires a header change, but the APIs are introduced and are functional. Add a smoke test for the aligned version of the operators. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48031 llvm-svn: 334505
* [scudo] Overhaul malloc related interceptorsKostya Kortchinsky2018-01-251-0/+83
Summary: This is a follow-up to D42506. There are a few of things that bothered me about `scudo_interceptors.cpp`: - the filename is a misnomer: it intercepts some functions, but the rest (C++) is actually in `scudo_new_delete.cpp`. I feel like `scudo_malloc.cpp` is more appropriate (ASan uses the same naming scheme); - we do not need "full" interceptors, since we are never accessing the unsanitized version of the functions, we just need the `extern "C" INTERCEPTOR_ATTRIBUTE` part of it to just call our functions; - a couple of functions where duplicated while they could just be `ALIAS`'d; - use the `SANITIZER_INTERCEPT_*` defines to hide the unneeded interceptors; - use `SIZE_T` instead of `uptr`: while it's the same behind the curtain, the former is meant for this use case. In the end there is no functional change on the currently supported platforms (Linux, Android). Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: mgorny, hintonda, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D42546 llvm-svn: 323464
OpenPOWER on IntegriCloud