int main(void)
{
- int i;
+ int i, *x1, *x2, *x3, *x4;
for (i = 0; i < 1500; i++) {
- int* x1 = malloc( 800 * 1000);
- int* x2 = malloc(1100 * 1000);
+ x1 = malloc( 800 * 1000);
+ x2 = malloc(1100 * 1000);
free(x1);
- int* x3 = malloc(1200 * 1000);
+ x3 = malloc(1200 * 1000);
free(x2);
free(x3);
- int* x4 = malloc( 900 * 1000);
+ x4 = malloc( 900 * 1000);
free(x4);
}
return 0;
using std::nothrow_t;
// A big structure. Its details don't matter.
-struct s {
- int array[1000];
-};
+typedef struct {
+ int array[1000];
+ } s;
int main(void)
{
- struct s* p1 = new struct s;
- struct s* p2 = new (std::nothrow) struct s;
+ s* p1 = new s;
+ s* p2 = new (std::nothrow) s;
char* c1 = new char[2000];
char* c2 = new (std::nothrow) char[2000];
delete p1;
using std::nothrow_t;
// A big structure. Its details don't matter.
-struct s {
- int array[1000];
-};
+typedef struct {
+ int array[1000];
+ } s;
void* operator new (std::size_t n) throw (std::bad_alloc)
{
int main(void)
{
- struct s* p1 = new struct s;
- struct s* p2 = new (std::nothrow) struct s;
+ s* p1 = new s;
+ s* p2 = new (std::nothrow) s;
char* c1 = new char[2000];
char* c2 = new (std::nothrow) char[2000];
delete p1;