NativeAllocationRegistryTest fix and cleanup
Make gNumNativeBytesAllocated atomic; it's incremented and decremented
by different threads!
Fix expectedMaxNumAllocations to look at just Java memory. Probably
doesn't matter, but makes a lot more sense.
Add runFinalization call to make sure we have a clean slate. I'm not
sure this is necessary to run Cleaners, but it can't hurt.
Explicitly check that we filled in the saved table. It's hard to see
how we wouldn't, but it was also hard to see how the following check
could fail.
Test: atest CtsLibcoreTestCases:libcore.libcore.util.NativeAllocationRegistryTest
Bug: 131560790
Change-Id: I6cb17479e50681f4f944b8efc5dda3ecd37488f8
2 files changed