Path: blob/main/contrib/llvm-project/compiler-rt/lib/memprof/memprof_preinit.cpp
35236 views
//===-- memprof_preinit.cpp ----------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// This file is a part of MemProfiler, a memory profiler.9//10// Call __memprof_init at the very early stage of process startup.11//===----------------------------------------------------------------------===//12#include "memprof_internal.h"1314using namespace __memprof;1516#if SANITIZER_CAN_USE_PREINIT_ARRAY17// This section is linked into the main executable when -fmemory-profile is18// specified to perform initialization at a very early stage.19__attribute__((section(".preinit_array"), used)) static auto preinit =20__memprof_preinit;21#endif222324