Conversation
…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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
field_value_android.h, change thestd::vector<FieldValue>andMapFieldValueconstructors to take const references, instead of values. This reduces by half the number of global references needed whenDocumentReference::Set(),DocumentReference::Update(), andCollectionReference::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::movethese values into theFieldValueInternalconstructor, 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.