LruCache: Improve efficieny and ease of use of APIs
* Add a Find() function that returns the pointer to the value associated with a key, further changes to the value using that poitner does not warm up the cache * Remove eviction callback, but instead return an optional evicted node when Put() evicts a cold node. This prevents potential deadlock when calling LruCache methods in the callback * HasKey() is not zero-copy * Get() calls Find() * Add unit tests for these new features * Modify MetricIdAllocator to use these new features Bug: 143515989 Test: atest --host bluetooth_test_common Change-Id: I9071c86a9041e5c95b349824889ccedf9f9c18dc Merged-In: I9071c86a9041e5c95b349824889ccedf9f9c18dc (cherry picked from commit 42f8c2b972c3fb39a9b1e3fbff3fcb3a0060c33e)
Loading
Please register or sign in to comment