Native allocation accounting

Added two new functions: registerNativeAllocation and registerNativeFree.
These functions should be used to let the GC know about native allocations
which are held live by Java objects and released in finalizers. GC are performed
or requested from within registerNativeAllocation when the total number of native
bytes accounted for exceeds a certain threshold. After a GC occurs in
registerNativeAllocation, finalizers are run so that the native memory is freed.
Added a test which shows how to use these functions.

Change-Id: I40f3c79e1c02d5008dec7d58d61c5bb97ec2fc1b
7 files changed
tree: 3bbad0d24eb69e28454fc403c7e8be1a70af1230
  1. build/
  2. dalvikvm/
  3. jdwpspy/
  4. src/
  5. test/
  6. tools/
  7. .gitignore
  8. Android.mk