Commit d7d5fde5 authored by Hans Boehm's avatar Hans Boehm
Browse files

Allow size for malloc-only registration

Encode malloc-only allocations with an odd size field.

These are treated similarly to the prior treatment of zero size
objects, except that:

- Huge allocations cause more frequent mallinfo() checks.
- The sizes are stored, and hence available to ahat and friends.

Add public factory methods to hide the negative size representation
and provide a slightly easier-to-describe-and-use API.

Add registerNativeAllocation(long) and registerNativeFree(long)
methods to VMRuntime to avoid enshrining the obsolete ones in the
platform API. Unfortunately we need to retain the old ones for
compatibility, at least for now.

See also ag/6235934 .

Bug: 121304803
Test: build and boot AOSP
Change-Id: Idccb8b50d26c8c3e93cc34040d784f74dfcdbf51
parent b4b11e1f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment