Skip to content

Commit

Permalink
Add feature flag to disable pre-allocation on clone
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Andrei Shikov authored and facebook-github-bot committed Mar 2, 2022
1 parent f47082b commit 131844f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 << ").";
Expand Down Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ class Binding : public jni::HybridClass<Binding>,
bool enableFabricLogs_{false};
bool disableRevisionCheckForPreallocation_{false};
bool dispatchPreallocationInBackground_{false};
bool disablePreallocationOnClone_{false};
};

} // namespace react
Expand Down

0 comments on commit 131844f

Please sign in to comment.