RefBase: add counter sanity checks for incStrong / incWeak
Summary: If there's a severe leak of RefBase objects like `AIBinder*`, catch the issue on
incrementing ref counters in addition to decrementing. This will prevent
cases when a leak happens in one place where it always increments the
counter, and then all of a sudden in different place someone releases a
reference will result in crash.
Test: Manually verified that if AIBinder significantly leaks ref counter, the process will crash
and the call stack will clearly indicate leaking source, with the following abort message:
```
Abort message: incWeak called on 0x7e033207c0 too many times, weak refs = 1048576
```
Change-Id: I1b58d5b851ef0e6abfbedc7f710ce49215bb2def
Signed-off-by: Abdelrahman Daim <adaim@meta.com>
1 file changed