STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Macros | Typedefs | Functions | Variables
new File Reference
#include <bits/c++config.h>
#include <exception>

Classes

class  std::bad_alloc
 STL class.
 
struct  std::nothrow_t
 

Macros

#define _NEW
 

Typedefs

typedef void(* std::new_handler )()
 

Functions

new_handler std::set_new_handler (new_handler) throw ()
 

Variables

const nothrow_t std::nothrow
 
void *operator new(std::size_t)
_GLIBCXX_THROW(std void
*operator new[](std::size_t)
_GLIBCXX_THROW(std void 
operator delete (void *) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__))
 
void operator delete[] (void *) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__))
 
void * operator new (std::size_t, const std::nothrow_t &) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__))
 
void * operator new[] (std::size_t, const std::nothrow_t &) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__))
 
void operator delete (void *, const std::nothrow_t &) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__))
 
void operator delete[] (void *, const std::nothrow_t &) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__))
 
void * operator new (std::size_t, void *__p) _GLIBCXX_USE_NOEXCEPT
 
void * operator new[] (std::size_t, void *__p) _GLIBCXX_USE_NOEXCEPT
 
void operator delete (void *, void *) _GLIBCXX_USE_NOEXCEPT
 
void operator delete[] (void *, void *) _GLIBCXX_USE_NOEXCEPT
 

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 http://gcc.gnu.org/onlinedocs/libstdc++/18_support/howto.html#4 for more.

Macro Definition Documentation

#define _NEW

Function Documentation

void operator delete ( void *  ,
const std::nothrow_t  
)
void operator delete ( void *  ,
void *   
)
inline
115 { }
void operator delete[] ( void *  )
void operator delete[] ( void *  ,
const std::nothrow_t  
)
void operator delete[] ( void *  ,
void *   
)
inline
116 { }
void* operator new ( std::size_t  ,
const std::nothrow_t  
)
void* operator new ( std::size_t  ,
void *  __p 
)
inline
110 { return __p; }
void* operator new[] ( std::size_t  ,
const std::nothrow_t  
)
void* operator new[] ( std::size_t  ,
void *  __p 
)
inline
112 { return __p; }

Variable Documentation

void* operator new (std::size_t) _GLIBCXX_THROW (std void* operator new[] (std::size_t) _GLIBCXX_THROW (std void operator delete(void *) _GLIBCXX_USE_NOEXCEPT __attribute__((__externally_visible__))

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.