| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…ue constructors to take const references, instead of values
❌ Integration test FAILEDRequested by @dconeybe on commit afa0cdd
Add flaky tests to go/fpl-cpp-flake-tracker |
Sorry, something went wrong.
There was a problem hiding this comment.
Thank you!
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
In field_value_android.h, change the std::vector<FieldValue> and MapFieldValue constructors to take const references, instead of values. This reduces by half the number of global references needed when DocumentReference::Set(), DocumentReference::Update(), and CollectionReference::Add() are called on Android.
Since these 3 methods are part of the public interface and take const references as their arguments, they are not able to std::move these values into the FieldValueInternal constructor, thus requiring copies. On Android, these copies necessitate doubling the number of JNI global references in use, making it much easier to hit the 51,200 hard limit.
This is the first part of a proper fix for the global refs exhaustion issue reported in firebase/quickstart-unity#1303 and firebase/quickstart-unity#1193 (comment) (Googlers see b/251869890 for more details). This should help alleviate the immediate problems being experienced by these customers. A proper fix is much more complicated and will take time to implement. Hopefully the improvement in this PR will be sufficient to unblock those customers.