LLVM
8.0.1
include
llvm
Support
BuryPointer.h
Go to the documentation of this file.
1
//===- llvm/Support/BuryPointer.h - Memory Manipulation/Leak ----*- C++ -*-===//
2
//
3
// The LLVM Compiler Infrastructure
4
//
5
// This file is distributed under the University of Illinois Open Source
6
// License. See LICENSE.TXT for details.
7
//
8
//===----------------------------------------------------------------------===//
9
10
#ifndef LLVM_SUPPORT_BURYPOINTER_H
11
#define LLVM_SUPPORT_BURYPOINTER_H
12
13
#include <memory>
14
15
namespace
llvm
{
16
17
// In tools that will exit soon anyway, going through the process of explicitly
18
// deallocating resources can be unnecessary - better to leak the resources and
19
// let the OS clean them up when the process ends. Use this function to ensure
20
// the memory is not misdiagnosed as an unintentional leak by leak detection
21
// tools (this is achieved by preserving pointers to the object in a globally
22
// visible array).
23
void
BuryPointer
(
const
void
*Ptr);
24
template
<
typename
T>
void
BuryPointer
(std::unique_ptr<T> Ptr) {
25
BuryPointer
(Ptr.release());
26
}
27
28
}
// namespace llvm
29
30
#endif
llvm::BuryPointer
void BuryPointer(const void *Ptr)
Definition:
BuryPointer.cpp:16
llvm
This class represents lattice values for constants.
Definition:
AllocatorList.h:24
Generated on Sun Dec 20 2020 13:53:34 for LLVM by
1.8.13