Mike Fiore
/
nucleo_new_test
test program demonstrating memory allocation failure on STMicro Nucleo F401RE
main.cpp
- Committer:
- mfiore
- Date:
- 2014-08-26
- Revision:
- 0:ffc1aff71c81
File content as of revision 0:ffc1aff71c81:
#include "mbed.h" int main() { char i = 0; char* x[8]; printf("new %d\r\n", i); x[i++] = new char[256]; printf("new %d\r\n", i); x[i++] = new char[256]; printf("new %d\r\n", i); x[i++] = new char[256]; printf("new %d\r\n", i); x[i++] = new char[256]; printf("new %d\r\n", i); x[i++] = new char[256]; printf("new %d\r\n", i); x[i++] = new char[256]; printf("new %d\r\n", i); x[i++] = new char[256]; printf("new %d\r\n", i); x[i++] = new char[256]; printf("done\r\n"); }