bad_alloc0.cpp 250 B

1234567891011
  1. /*
  2. ulimit -S -v 204800
  3. g++ -g -O0 bad_alloc0.cpp -o bad_alloc && ./bad_alloc
  4. */
  5. #include <stdio.h>
  6. int main(){
  7. char* p1 = new char[193000 * 1024]; // huge allocation
  8. char* p0 = new char[100 * 1024]; // small allocation
  9. printf("OK\n");
  10. }