16#ifndef LLVM_SUPPORT_MEMALLOC_H
17#define LLVM_SUPPORT_MEMALLOC_H
26 void *Result = std::malloc(Sz);
27 if (Result ==
nullptr) {
40 void *Result = std::calloc(Count, Sz);
41 if (Result ==
nullptr) {
45 if (Count == 0 || Sz == 0)
53 void *Result = std::realloc(
Ptr, Sz);
54 if (Result ==
nullptr) {
#define LLVM_ATTRIBUTE_RETURNS_NOALIAS
\macro LLVM_ATTRIBUTE_RETURNS_NOALIAS Used to mark a function as returning a pointer that does not al...
#define LLVM_ATTRIBUTE_RETURNS_NONNULL
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_calloc(size_t Count, size_t Sz)
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * allocate_buffer(size_t Size, size_t Alignment)
Allocate a buffer of memory with the given size and alignment.
void deallocate_buffer(void *Ptr, size_t Size, size_t Alignment)
Deallocate a buffer of memory with the given size and alignment.
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc(size_t Sz)
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_realloc(void *Ptr, size_t Sz)
void report_bad_alloc_error(const char *Reason, bool GenCrashDiag=true)
Reports a bad alloc error, calling any user defined bad alloc error handler.