1 //===-- wrappers_c.cc -------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 // Skip this compilation unit if compiled as part of Bionic.
12 #if !SCUDO_ANDROID || !_BIONIC
14 #include "allocator_config.h"
15 #include "wrappers_c.h"
16 #include "wrappers_c_checks.h"
21 static scudo::Allocator<scudo::Config> Allocator;
22 // Pointer to the static allocator so that the C++ wrappers can access it.
23 // Technically we could have a completely separated heap for C & C++ but in
24 // reality the amount of cross pollination between the two is staggering.
25 scudo::Allocator<scudo::Config> *AllocatorPtr = &Allocator;
29 #define SCUDO_PREFIX(name) name
30 #define SCUDO_ALLOCATOR Allocator
31 #include "wrappers_c.inc"
32 #undef SCUDO_ALLOCATOR
35 INTERFACE void __scudo_print_stats(void) { Allocator.printStats(); }
39 #endif // !SCUDO_ANDROID || !_BIONIC