Command line help - demangling isn't just for C++
[valgrind.git] / massif / tests / new-cpp.cpp
blob44e87c219a43e3d0d94df4c5910e0b3e7cc40bb0
1 // operator new(unsigned)
2 // operator new[](unsigned)
3 // operator new(unsigned, std::nothrow_t const&)
4 // operator new[](unsigned, std::nothrow_t const&)
6 #include <stdlib.h>
8 #include <new>
10 using std::nothrow_t;
12 // A big structure. Its details don't matter.
13 typedef struct {
14 int array[1000];
15 } s;
17 int main(void)
19 s* p1 = new s;
20 s* p2 = new (std::nothrow) s;
21 char* c1 = new char[2000];
22 char* c2 = new (std::nothrow) char[2000];
23 delete p1;
24 delete p2;
25 delete [] c1;
26 delete [] c2;
27 return 0;