diff options
| author | Hans Wennborg <hans@hanshq.net> | 2019-06-26 09:46:26 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2019-06-26 09:46:26 +0000 |
| commit | 1a0810407edcff9791a5354d762ef8b4e7c07287 (patch) | |
| tree | 0c2fe9f6d6948ecc498b0d79a99b387c31b2074b /compiler-rt/lib/scudo/standalone/wrappers_c.cc | |
| parent | 639d36b34e6eae75ee211bba83b7e45151e1272d (diff) | |
| download | bcm5719-llvm-1a0810407edcff9791a5354d762ef8b4e7c07287.tar.gz bcm5719-llvm-1a0810407edcff9791a5354d762ef8b4e7c07287.zip | |
Revert r364332 "[scudo][standalone] Introduce the C & C++ wrappers"
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
Diffstat (limited to 'compiler-rt/lib/scudo/standalone/wrappers_c.cc')
| -rw-r--r-- | compiler-rt/lib/scudo/standalone/wrappers_c.cc | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/compiler-rt/lib/scudo/standalone/wrappers_c.cc b/compiler-rt/lib/scudo/standalone/wrappers_c.cc deleted file mode 100644 index 5908c600be3..00000000000 --- a/compiler-rt/lib/scudo/standalone/wrappers_c.cc +++ /dev/null @@ -1,39 +0,0 @@ -//===-- wrappers_c.cc -------------------------------------------*- C++ -*-===// -// -// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. -// See https://llvm.org/LICENSE.txt for license information. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -// -//===----------------------------------------------------------------------===// - -#include "platform.h" - -// Skip this compilation unit if compiled as part of Bionic. -#if !SCUDO_ANDROID || !_BIONIC - -#include "allocator_config.h" -#include "wrappers_c.h" -#include "wrappers_c_checks.h" - -#include <stdint.h> -#include <stdio.h> - -static scudo::Allocator<scudo::Config> Allocator; -// Pointer to the static allocator so that the C++ wrappers can access it. -// Technically we could have a completely separated heap for C & C++ but in -// reality the amount of cross pollination between the two is staggering. -scudo::Allocator<scudo::Config> *AllocatorPtr = &Allocator; - -extern "C" { - -#define SCUDO_PREFIX(name) name -#define SCUDO_ALLOCATOR Allocator -#include "wrappers_c.inc" -#undef SCUDO_ALLOCATOR -#undef SCUDO_PREFIX - -INTERFACE void __scudo_print_stats(void) { Allocator.printStats(); } - -} // extern "C" - -#endif // !SCUDO_ANDROID || !_BIONIC |

