program to find out whether malloc() returns NULL on a failed call or not

Dependencies:   mbed

main.cpp

Committer:
hlipka
Date:
2011-01-01
Revision:
1:602fea3e6f8b
Parent:
0:77b549539791

File content as of revision 1:602fea3e6f8b:

#include <stdio.h>
#include "mbed.h"

#define MALLOC_SIZE 0x2000

class C2: Base
{
    public:
        C2(int a){_a=a;}
    private:
        int _a;
};

C2 a(1);
C2 b(2);

int main() {
    printf("doing test\n");
        malloc(MALLOC_SIZE);
        malloc(MALLOC_SIZE);
        malloc(MALLOC_SIZE);
        malloc(MALLOC_SIZE);
        printf("finished\n");
}