title: Operator new does not throw bad_alloc on Android
body: <p>I am developing a C++ game on Android NDK (android-ndk-r9b). If I write this:</p>
  
  <pre><code>class Test
  {
      char c[1024*1024*1024];
  };
  
  //in main
  try {
  
      Test* p;
      while (1) {
          p = new Test();
      }
  } catch (bad_alloc) {
      cout &lt;&lt; "bad_alloc\n";
  }
  </code></pre>
  
  <p>it doesn't throw. If I try this:</p>
  
  <pre><code>void no_memory_by_new() {
      cout &lt;&lt; "no_memory_by_new\n";
      throw bad_alloc();
  }
  
  //in main
  set_new_handler(no_memory_by_new);
  Test* p;
  while (1) {
      p = new Test();
  }
  </code></pre>
  
  <p>it doesn't work either. Finally, if I try this:</p>
  
  <pre><code>//in main
  set_new_handler(no_memory_by_new);
  int* p;
  while (1) {
      p = new int[1024*1024*1024];
  }
  </code></pre>
  
  <p>then <code>no_memory_by_new</code> is called. I'm really confused about this. Can anyone help me?</p>