Files
ftmemsim-valgrind/massif/tests/new-cpp.cpp
Nicholas Nethercote 62eed24c67 Merged the MASSIF2 branch to the trunk. Main changes:
- ms_main.c: completely overhauled.

- massif/tests/*:  lots of them now.

- massif/perf/:  added.

- massif/hp2ps:  removed.  No longer used.

- vg_regtest: renamed the previously unused "posttest" notion to "post".
  Using it for checking ms_print's output.

Although the code has changed dramatically, as has the form of the tool's
output, the information presented in the output is basically the same,
although it's now (hopefully) much more useful.  So the tool name is
unchanged.



git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7069
2007-11-01 04:40:37 +00:00

31 lines
595 B
C++

// operator new(unsigned)
// operator new[](unsigned)
// operator new(unsigned, std::nothrow_t const&)
// operator new[](unsigned, std::nothrow_t const&)
#include <stdlib.h>
#include <new>
using std::nothrow_t;
// A big structure. Its details don't matter.
struct s {
int array[1000];
};
int main(void)
{
struct s* p1 = new struct s;
struct s* p2 = new (std::nothrow) struct s;
char* c1 = new char[2000];
char* c2 = new (std::nothrow) char[2000];
delete p1;
delete p2;
delete [] c1;
delete [] c2;
return 0;
}