Back to index

cell-binutils  2.17cvs20070401
Classes | Functions | Variables
dl5.cc File Reference
#include <stdio.h>
#include <stdlib.h>
#include <new>

Go to the source code of this file.

Classes

struct  A

Functions

void * operator new (size_t sz, const std::nothrow_t &) throw ()
void * operator new (size_t sz) throw (std::bad_alloc)
void operator delete (void *ptr) throw ()
int main (void)

Variables

int pass = 0

Function Documentation

int main ( void  )

Definition at line 44 of file dl5.cc.

{
  A *bb = new A[10];
  delete [] bb;
  bb = new (std::nothrow) A [10];
  delete [] bb;

  if (pass == 4)
    {
      printf ("PASS\n");
      return 0;
    }
  else
    {
      printf ("FAIL\n");
      return 1;
    }
}

Here is the call graph for this function:

void operator delete ( void *  ptr) throw ()

Definition at line 26 of file dl5.cc.

{
  pass++;
  if (ptr)
    free (ptr);
}

Here is the call graph for this function:

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

Definition at line 8 of file dl5.cc.

{
  void *p;
  pass++;
  p = malloc(sz);
  return p;
}

Here is the call graph for this function:

Here is the caller graph for this function:

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

Definition at line 17 of file dl5.cc.

{
  void *p;
  pass++;
  p = malloc(sz);
  return p;
}

Here is the call graph for this function:


Variable Documentation

int pass = 0

Definition at line 5 of file dl5.cc.