Add feature flag to disable pre-allocation on clone

Summary:
Disables preallocation for cloned nodes, switching to create during commit for those cases instead.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D34555621

fbshipit-source-id: 21fc834cea318ca299aa37a9aab28a2f2a9675b5
This commit is contained in:
Andrei Shikov
2022-03-01 18:10:49 -08:00
committed by Facebook GitHub Bot
parent f47082be11
commit 131844f40e
2 changed files with 7 additions and 0 deletions
@@ -367,6 +367,9 @@ void Binding::installFabricUIManager(
disableRevisionCheckForPreallocation_ =
config->getBool("react_fabric:disable_revision_check_for_preallocation");
disablePreallocationOnClone_ = config->getBool(
"react_native_new_architecture:disable_preallocation_on_clone_android");
if (enableFabricLogs_) {
LOG(WARNING) << "Binding::installFabricUIManager() was called (address: "
<< this << ").";
@@ -505,6 +508,9 @@ void Binding::schedulerDidCloneShadowNode(
SurfaceId surfaceId,
ShadowNode const &oldShadowNode,
ShadowNode const &newShadowNode) {
if (disablePreallocationOnClone_) {
return;
}
// This is only necessary if view preallocation was skipped during
// createShadowNode
@@ -156,6 +156,7 @@ class Binding : public jni::HybridClass<Binding>,
bool enableFabricLogs_{false};
bool disableRevisionCheckForPreallocation_{false};
bool dispatchPreallocationInBackground_{false};
bool disablePreallocationOnClone_{false};
};
} // namespace react