Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
allocation_failure.H File Reference

A global operator new that a test can make fail. More...

#include <cstddef>
#include <cstdlib>
#include <new>
Include dependency graph for allocation_failure.H:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ALEPH_ALLOCATION_FAILURE_UNDER_TSAN   0
 

Functions

void * operator new (const std::size_t size)
 
void * operator new[] (const std::size_t size)
 
void * operator new (const std::size_t size, const std::nothrow_t &) noexcept
 
void * operator new[] (const std::size_t size, const std::nothrow_t &) noexcept
 
void operator delete (void *p) noexcept
 
void operator delete[] (void *p) noexcept
 
void operator delete (void *p, std::size_t) noexcept
 
void operator delete[] (void *p, std::size_t) noexcept
 
void operator delete (void *p, const std::nothrow_t &) noexcept
 
void operator delete[] (void *p, const std::nothrow_t &) noexcept
 

Detailed Description

A global operator new that a test can make fail.

A test program that includes this header, in one of its source files, replaces the global operator new: while a No_Memory lives, every allocation through it throws std::bad_alloc, and while a Fail_At lives, the one with the number that it was given does. allocations counts them all.

ThreadSanitizer has its own global operator new and delete, which collide with these at link time, so under it nothing is replaced and ALEPH_ALLOCATION_FAILURE_UNDER_TSAN is 1: the tests must skip then.

Definition in file allocation_failure.H.

Macro Definition Documentation

◆ ALEPH_ALLOCATION_FAILURE_UNDER_TSAN

#define ALEPH_ALLOCATION_FAILURE_UNDER_TSAN   0

Definition at line 62 of file allocation_failure.H.

Function Documentation

◆ operator delete() [1/3]

void operator delete ( void *  p)
noexcept

Definition at line 157 of file allocation_failure.H.

◆ operator delete() [2/3]

void operator delete ( void *  p,
const std::nothrow_t &   
)
noexcept

Definition at line 177 of file allocation_failure.H.

◆ operator delete() [3/3]

void operator delete ( void *  p,
std::size_t   
)
noexcept

Definition at line 167 of file allocation_failure.H.

◆ operator delete[]() [1/3]

void operator delete[] ( void *  p)
noexcept

Definition at line 162 of file allocation_failure.H.

◆ operator delete[]() [2/3]

void operator delete[] ( void *  p,
const std::nothrow_t &   
)
noexcept

Definition at line 182 of file allocation_failure.H.

◆ operator delete[]() [3/3]

void operator delete[] ( void *  p,
std::size_t   
)
noexcept

Definition at line 172 of file allocation_failure.H.

◆ operator new() [1/2]

void * operator new ( const std::size_t  size)

Definition at line 115 of file allocation_failure.H.

◆ operator new() [2/2]

void * operator new ( const std::size_t  size,
const std::nothrow_t &   
)
noexcept

Definition at line 127 of file allocation_failure.H.

◆ operator new[]() [1/2]

void * operator new[] ( const std::size_t  size)

Definition at line 120 of file allocation_failure.H.

◆ operator new[]() [2/2]

void * operator new[] ( const std::size_t  size,
const std::nothrow_t &   
)
noexcept

Definition at line 139 of file allocation_failure.H.