Bring our native stack usage down.

I'd have preferred to have a 512-byte limit, but there are some monsters
in the verifier; 2000-line functions and the like. I'm also not policing
tests (except for one silly one). They can use all the stack they like.

This fixes the IntMath test (the stack overflow test was failing because
we were using more than 4KiB to throw!).

Change-Id: I7e53e2fde2b39fde1910f8ee5b1712e8a66069c7
diff --git a/src/object_bitmap.cc b/src/object_bitmap.cc
index 483feac..1a3d600 100644
--- a/src/object_bitmap.cc
+++ b/src/object_bitmap.cc
@@ -152,8 +152,9 @@
     // TODO: this should never happen
     return;
   }
-  void* pointer_buf[4 * kBitsPerWord];
-  void** pb = pointer_buf;
+  // TODO: rewrite the callbacks to accept a std::vector<void*> rather than a void**?
+  std::vector<void*> pointer_buf(4 * kBitsPerWord);
+  void** pb = &pointer_buf[0];
   size_t start = HB_OFFSET_TO_INDEX(base - live_bitmap.base_);
   size_t end = HB_OFFSET_TO_INDEX(max - live_bitmap.base_);
   word* live = live_bitmap.words_;
@@ -170,14 +171,14 @@
       }
       // Make sure that there are always enough slots available for an
       // entire word of one bits.
-      if (pb >= &pointer_buf[ARRAYSIZE_UNSAFE(pointer_buf) - kBitsPerWord]) {
-        (*callback)(pb - pointer_buf, pointer_buf, arg);
-        pb = pointer_buf;
+      if (pb >= &pointer_buf[pointer_buf.size() - kBitsPerWord]) {
+        (*callback)(pb - &pointer_buf[0], &pointer_buf[0], arg);
+        pb = &pointer_buf[0];
       }
     }
   }
-  if (pb > pointer_buf) {
-    (*callback)(pb - pointer_buf, pointer_buf, arg);
+  if (pb > &pointer_buf[0]) {
+    (*callback)(pb - &pointer_buf[0], &pointer_buf[0], arg);
   }
 }