Track native allocations differently
This CL allows the DelegateManager to track native allocations once we know the java object that will be pointing to the delegate. When we know that relation, we can attach the lifecycle of the delegate to the lifecycle of the java object. Once the java object is not referenced anymore, we can dispose the reference to the delegate. This kind of replicates the behaviour of the NativeAllocationTracker but we do not rely on enqueing references by the PhantomReference. With this approach, we are more active about removing delegates instead of relying on the PhantomReference notifying us. Bug: 78254948 Test: Existing tests pass Change-Id: Ic58c52e93bd690646e5f34d15c76966014737528 (cherry picked from commit 4fc6e534001b94ae87c0945eebf29d97d8b34e12)
Loading
Please sign in to comment