1 //===-- memprof_preinit.cpp ----------------------------------------------===//
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 //===----------------------------------------------------------------------===//
9 // This file is a part of MemProfiler, a memory profiler.
11 // Call __memprof_init at the very early stage of process startup.
12 //===----------------------------------------------------------------------===//
13 #include "memprof_internal.h"
15 using namespace __memprof
;
17 #if SANITIZER_CAN_USE_PREINIT_ARRAY
18 // This section is linked into the main executable when -fmemory-profile is
19 // specified to perform initialization at a very early stage.
20 __attribute__((section(".preinit_array"), used
)) static auto preinit
=