| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
This PR adds cache validation functionality to the LRUCache implementation to check for stale weak global references in the ObjectManager. It introduces a callback mechanism to validate cached entries before they are used, preventing the use of invalidated Java weak references.
Key changes:
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test-app/runtime/src/main/cpp/ObjectManager.h | Added declaration for ValidateWeakGlobalRefCallback method |
| test-app/runtime/src/main/cpp/ObjectManager.cpp | Implemented validation callback and updated cache initialization to use it; removed unused variable |
| test-app/runtime/src/main/cpp/LRUCache.h | Added validation callback support, implemented evictKey helper method, and switched to robin_hood hash map |
| test-app/runtime/src/main/cpp/JEnv.h | Added isSameObject helper method for JNI object comparison |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
| Back | FazBrowse Home | New Git URL |
Occasionally (mostly on android API 26.1+) a jweak reference might point to NULL even when the actual Java object exists.
I believe this is a JNI/Android bug, but as a workaround, we now check if this reference is null, and if so we evict the key from the cache which then is going to re-fetch it and error out if it's actually null in Java