Skip to content

Commit 6f7428e

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
Delete feature flag enable_simulate_image_props_memory_access
Summary: changelog: [internal] Clean up unused feature flag Reviewed By: fkgozali Differential Revision: D42709723 fbshipit-source-id: 289697dfb0c0378ff0369e1474150f7be68c8635
1 parent 8863be4 commit 6f7428e

File tree

3 files changed

+0
-54
lines changed

3 files changed

+0
-54
lines changed

React/Fabric/RCTScheduler.mm

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,6 @@ - (instancetype)initWithToolbox:(SchedulerToolbox)toolbox
115115
_layoutAnimationDelegateProxy = std::make_shared<LayoutAnimationDelegateProxy>((__bridge void *)self);
116116
_animationDriver = std::make_shared<LayoutAnimationDriver>(
117117
toolbox.runtimeExecutor, toolbox.contextContainer, _layoutAnimationDelegateProxy.get());
118-
119-
if (reactNativeConfig->getBool("react_fabric:enable_simulate_image_props_memory_access")) {
120-
_animationDriver->enableSimulateImagePropsMemoryAccess();
121-
}
122118
_uiRunLoopObserver =
123119
toolbox.mainRunLoopObserverFactory(RunLoopObserver::Activity::BeforeWaiting, _layoutAnimationDelegateProxy);
124120
_uiRunLoopObserver->setDelegate(_layoutAnimationDelegateProxy.get());

ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.cpp

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,6 @@ LayoutAnimationKeyFrameManager::pullTransaction(
171171
MountingTransaction::Number transactionNumber,
172172
TransactionTelemetry const &telemetry,
173173
ShadowViewMutationList mutations) const {
174-
simulateImagePropsMemoryAccess(mutations);
175174
// Current time in milliseconds
176175
uint64_t now = now_();
177176

@@ -1086,8 +1085,6 @@ LayoutAnimationKeyFrameManager::pullTransaction(
10861085
}
10871086
}
10881087

1089-
simulateImagePropsMemoryAccess(mutations);
1090-
10911088
return MountingTransaction{
10921089
surfaceId, transactionNumber, std::move(mutations), telemetry};
10931090
}
@@ -1108,10 +1105,6 @@ void LayoutAnimationKeyFrameManager::setClockNow(
11081105
now_ = std::move(now);
11091106
}
11101107

1111-
void LayoutAnimationKeyFrameManager::enableSimulateImagePropsMemoryAccess() {
1112-
simulateImagePropsMemoryAccess_ = true;
1113-
}
1114-
11151108
#pragma mark - Protected
11161109

11171110
bool LayoutAnimationKeyFrameManager::hasComponentDescriptorForShadowView(
@@ -1665,39 +1658,4 @@ void LayoutAnimationKeyFrameManager::deleteAnimationsForStoppedSurfaces()
16651658
}
16661659
}
16671660

1668-
void LayoutAnimationKeyFrameManager::simulateImagePropsMemoryAccess(
1669-
ShadowViewMutationList const &mutations) const {
1670-
if (!simulateImagePropsMemoryAccess_) {
1671-
return;
1672-
}
1673-
for (auto const &mutation : mutations) {
1674-
if (mutation.type != ShadowViewMutation::Type::Insert) {
1675-
continue;
1676-
}
1677-
if (strcmp(mutation.newChildShadowView.componentName, "Image") == 0) {
1678-
auto const &imageProps = *std::static_pointer_cast<ImageProps const>(
1679-
mutation.newChildShadowView.props);
1680-
int temp = 0;
1681-
switch (imageProps.resizeMode) {
1682-
case ImageResizeMode::Cover:
1683-
temp = 1;
1684-
break;
1685-
case ImageResizeMode::Contain:
1686-
temp = 2;
1687-
break;
1688-
case ImageResizeMode::Stretch:
1689-
temp = 3;
1690-
break;
1691-
case ImageResizeMode::Center:
1692-
temp = 4;
1693-
break;
1694-
case ImageResizeMode::Repeat:
1695-
temp = 5;
1696-
break;
1697-
}
1698-
(void)temp;
1699-
}
1700-
}
1701-
}
1702-
17031661
} // namespace facebook::react

ReactCommon/react/renderer/animations/LayoutAnimationKeyFrameManager.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ class LayoutAnimationKeyFrameManager : public UIManagerAnimationDelegate,
9090

9191
void setClockNow(std::function<uint64_t()> now);
9292

93-
void enableSimulateImagePropsMemoryAccess();
94-
9593
protected:
9694
SharedComponentDescriptorRegistry componentDescriptorRegistry_;
9795
mutable std::optional<LayoutAnimation> currentAnimation_{};
@@ -150,12 +148,6 @@ class LayoutAnimationKeyFrameManager : public UIManagerAnimationDelegate,
150148
mutable butter::set<SurfaceId> surfaceIdsToStop_{};
151149
bool reduceDeleteCreateMutation_{false};
152150

153-
/*
154-
* Feature flag that enables simulation of memory access. This is a temporary
155-
* flag to diagnose where crashes are coming from in LayoutAnimations on iOS.
156-
*/
157-
bool simulateImagePropsMemoryAccess_{false};
158-
159151
// Function that returns current time in milliseconds
160152
std::function<uint64_t()> now_;
161153

0 commit comments

Comments
 (0)