diff options
| author | Kostya Kortchinsky <kostyak@google.com> | 2018-06-12 14:42:40 +0000 |
|---|---|---|
| committer | Kostya Kortchinsky <kostyak@google.com> | 2018-06-12 14:42:40 +0000 |
| commit | 76969eaf3d386df61f4891d439a50b9c471a31e6 (patch) | |
| tree | 9bdf07546facf9c59bdfe2a318f34f3742e767a9 /compiler-rt/lib/scudo/scudo_malloc.cpp | |
| parent | c3466d2568f5f949d9caf229ab2301b5a79cacaf (diff) | |
| download | bcm5719-llvm-76969eaf3d386df61f4891d439a50b9c471a31e6.tar.gz bcm5719-llvm-76969eaf3d386df61f4891d439a50b9c471a31e6.zip | |
[scudo] Add C++17 aligned new/delete operators support
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
Diffstat (limited to 'compiler-rt/lib/scudo/scudo_malloc.cpp')
| -rw-r--r-- | compiler-rt/lib/scudo/scudo_malloc.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler-rt/lib/scudo/scudo_malloc.cpp b/compiler-rt/lib/scudo/scudo_malloc.cpp index eb1047ac075..6e83be42224 100644 --- a/compiler-rt/lib/scudo/scudo_malloc.cpp +++ b/compiler-rt/lib/scudo/scudo_malloc.cpp @@ -20,11 +20,11 @@ using namespace __scudo; extern "C" { INTERCEPTOR_ATTRIBUTE void free(void *ptr) { - scudoFree(ptr, FromMalloc); + scudoDeallocate(ptr, 0, 0, FromMalloc); } INTERCEPTOR_ATTRIBUTE void *malloc(SIZE_T size) { - return scudoMalloc(size, FromMalloc); + return scudoAllocate(size, 0, FromMalloc); } INTERCEPTOR_ATTRIBUTE void *realloc(void *ptr, SIZE_T size) { @@ -50,7 +50,7 @@ INTERCEPTOR_ATTRIBUTE void cfree(void *ptr) ALIAS("free"); #if SANITIZER_INTERCEPT_MEMALIGN INTERCEPTOR_ATTRIBUTE void *memalign(SIZE_T alignment, SIZE_T size) { - return scudoMemalign(alignment, size); + return scudoAllocate(size, alignment, FromMemalign); } INTERCEPTOR_ATTRIBUTE |

