libstdc++
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
new File Reference

Go to the source code of this file.

Classes

class  std::bad_alloc
 
struct  std::destroying_delete_t
 

Namespaces

 std
 

Typedefs

typedef void(* std::new_handler) ()
 

Enumerations

enum  align_val_t : size_t
 

Functions

new_handler std::get_new_handler () noexcept
 
new_handler std::set_new_handler (new_handler) throw ()
 
void * operator new (std::size_t)
 
void * operator new[] (std::size_t)
 
void operator delete (void *) noexcept
 
void operator delete[] (void *) noexcept
 
void operator delete (void *, std::size_t) noexcept
 
void operator delete[] (void *, std::size_t) noexcept
 
void * operator new (std::size_t, const std::nothrow_t &) noexcept
 
void * operator new[] (std::size_t, const std::nothrow_t &) noexcept
 
void operator delete (void *, const std::nothrow_t &) noexcept
 
void operator delete[] (void *, const std::nothrow_t &) noexcept
 
void * operator new (std::size_t, std::align_val_t)
 
void * operator new (std::size_t, std::align_val_t, const std::nothrow_t &) noexcept
 
void operator delete (void *, std::align_val_t) noexcept
 
void operator delete (void *, std::align_val_t, const std::nothrow_t &) noexcept
 
void * operator new[] (std::size_t, std::align_val_t)
 
void * operator new[] (std::size_t, std::align_val_t, const std::nothrow_t &) noexcept
 
void operator delete[] (void *, std::align_val_t) noexcept
 
void operator delete[] (void *, std::align_val_t, const std::nothrow_t &) noexcept
 
void operator delete (void *, std::size_t, std::align_val_t) noexcept
 
void operator delete[] (void *, std::size_t, std::align_val_t) noexcept
 
void * operator new (std::size_t, void *__p) noexcept
 
void * operator new[] (std::size_t, void *__p) noexcept
 
void operator delete (void *, void *) noexcept
 
void operator delete[] (void *, void *) noexcept
 

Variables

constexpr destroying_delete_t std::destroying_delete
 
const nothrow_t std::nothrow
 

Detailed Description

This is a Standard C++ Library header.

The header new defines several functions to manage dynamic memory and handling memory allocation errors; see https://gcc.gnu.org/onlinedocs/libstdc++/manual/dynamic_memory.html for more.

Definition in file new.

Function Documentation

◆ operator delete() [1/7]

void operator delete ( void *  )
noexcept

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator delete() [2/7]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator delete() [3/7]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator delete() [4/7]

void operator delete ( void *  ,
std::align_val_t   
)
noexcept

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator delete() [5/7]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator delete() [6/7]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator delete() [7/7]

void operator delete ( void *  ,
void *   
)
inlinenoexcept

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

Definition at line 185 of file new.

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

void operator delete[] ( void *  )
noexcept

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

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

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

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

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator delete[]() [4/7]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator delete[]() [5/7]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator delete[]() [6/7]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

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

void operator delete[] ( void *  ,
void *   
)
inlinenoexcept

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

Definition at line 186 of file new.

◆ operator new() [1/5]

void* operator new ( std::size_t  )

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator new() [2/5]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator new() [3/5]

void* operator new ( std::size_t  ,
std::align_val_t   
)

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator new() [4/5]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator new() [5/5]

void* operator new ( std::size_t  ,
void *  __p 
)
inlinenoexcept

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

Definition at line 179 of file new.

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

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

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

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator new[]() [3/5]

void* operator new[] ( std::size_t  ,
std::align_val_t   
)

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

◆ operator new[]() [4/5]

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

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

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

void* operator new[] ( std::size_t  ,
void *  __p 
)
inlinenoexcept

These are replaceable signatures:

  • normal single new and delete (no arguments, throw bad_alloc on error)
  • normal array new and delete (same)
  • nothrow single new and delete (take a nothrow argument, return NULL on error)
  • nothrow array new and delete (same)

Placement new and delete signatures (take a memory address argument, does nothing) may not be replaced by a user's program.

Definition at line 181 of file new.