Backport native allocation tracking.

From:
https://googleplex-android-review.googlesource.com/#/c/328818/

Change-Id: I5a930e629c5a2062f01f870b4a44dcd98cb4ffe9
7 files changed