LLVM
20.0.0git
include
llvm
Support
BuryPointer.h
Go to the documentation of this file.
1
//===- llvm/Support/BuryPointer.h - Memory Manipulation/Leak ----*- C++ -*-===//
2
//
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
6
//
7
//===----------------------------------------------------------------------===//
8
9
#ifndef LLVM_SUPPORT_BURYPOINTER_H
10
#define LLVM_SUPPORT_BURYPOINTER_H
11
12
#include <memory>
13
14
namespace
llvm
{
15
16
// In tools that will exit soon anyway, going through the process of explicitly
17
// deallocating resources can be unnecessary - better to leak the resources and
18
// let the OS clean them up when the process ends. Use this function to ensure
19
// the memory is not misdiagnosed as an unintentional leak by leak detection
20
// tools (this is achieved by preserving pointers to the object in a globally
21
// visible array).
22
void
BuryPointer
(
const
void
*
Ptr
);
23
template
<
typename
T>
void
BuryPointer
(std::unique_ptr<T>
Ptr
) {
24
BuryPointer
(
Ptr
.release());
25
}
26
27
}
// namespace llvm
28
29
#endif
Ptr
@ Ptr
Definition:
TargetLibraryInfo.cpp:77
llvm
This is an optimization pass for GlobalISel generic memory operations.
Definition:
AddressRanges.h:18
llvm::BuryPointer
void BuryPointer(const void *Ptr)
Definition:
BuryPointer.cpp:15
Generated on Sun Nov 24 2024 05:55:55 for LLVM by
1.9.6