Back to index

cell-binutils  2.17cvs20070401
Functions
new.cc File Reference
#include <new>
#include <exception_defines.h>

Go to the source code of this file.

Functions

void * malloc (std::size_t)
void abort (void)
void * operator new (std::size_t sz, const std::nothrow_t &) throw ()
void * operator new (std::size_t sz) throw (std::bad_alloc)
void * operator new[] (std::size_t sz) throw (std::bad_alloc)
void * operator new[] (std::size_t sz, const std::nothrow_t &nothrow) throw ()

Function Documentation

void abort ( void  )
void* malloc ( std::size_t  )
void* operator new ( std::size_t  sz,
const std::nothrow_t &   
) throw ()

Definition at line 10 of file new.cc.

{
  void *p;

  /* malloc (0) is unpredictable; avoid it.  */
  if (sz == 0)
    sz = 1;
  p = (void *) malloc (sz);
  return p;
}

Here is the call graph for this function:

void* operator new ( std::size_t  sz) throw (std::bad_alloc)

Definition at line 22 of file new.cc.

{
  void *p;

  /* malloc (0) is unpredictable; avoid it.  */
  if (sz == 0)
    sz = 1;
  p = (void *) malloc (sz);
  while (p == 0)
    {
      ::abort();
    }

  return p;
}

Here is the call graph for this function:

void* operator new[] ( std::size_t  sz) throw (std::bad_alloc)

Definition at line 39 of file new.cc.

Here is the call graph for this function:

void* operator new[] ( std::size_t  sz,
const std::nothrow_t &  nothrow 
) throw ()

Definition at line 45 of file new.cc.

{
  return ::operator new(sz, nothrow);
}

Here is the call graph for this function: