Skip to content

Commit dd6c23f

Browse files
mdvaccafacebook-github-bot
authored andcommitted
Delete YogaNodePool (#53944)
Summary: Pull Request resolved: #53944 YogaNodePool is an internal API used only by LegacyArchitecture of React Native Android, which is unused This diff deletes YogaNodePool from the codebase changelog: [internal] internal Reviewed By: alanleedev, cortinico Differential Revision: D83184441 fbshipit-source-id: 7c358985d9f19b38c28cca7fb0acf9322e97d87c
1 parent 218d2f6 commit dd6c23f

File tree

3 files changed

+2
-43
lines changed

3 files changed

+2
-43
lines changed

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/ReactShadowNodeImpl.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,7 @@ public class ReactShadowNodeImpl implements ReactShadowNode<ReactShadowNodeImpl>
106106
public ReactShadowNodeImpl() {
107107
mDefaultPadding = new Spacing(0f);
108108
if (!isVirtual()) {
109-
YogaNode node = YogaNodePool.get().acquire();
110-
mYogaNode = node == null ? YogaNodeFactory.create(sYogaConfig) : node;
109+
mYogaNode = YogaNodeFactory.create(sYogaConfig);
111110
mYogaNode.setData(this);
112111
Arrays.fill(mPadding, YogaConstants.UNDEFINED);
113112
} else {
@@ -1101,7 +1100,6 @@ private void getHierarchyInfoWithIndentation(StringBuilder result, int level) {
11011100
public void dispose() {
11021101
if (mYogaNode != null) {
11031102
mYogaNode.reset();
1104-
YogaNodePool.get().release(mYogaNode);
11051103
}
11061104
}
11071105

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/UIManagerModule.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ public void invalidate() {
219219
ReactApplicationContext reactApplicationContext = getReactApplicationContext();
220220
reactApplicationContext.unregisterComponentCallbacks(mMemoryTrimCallback);
221221
reactApplicationContext.unregisterComponentCallbacks(mViewManagerRegistry);
222-
YogaNodePool.get().clear();
223222
ViewManagerPropertyUpdater.clear();
224223
}
225224

@@ -815,11 +814,7 @@ public void runGuarded() {
815814
private static class MemoryTrimCallback implements ComponentCallbacks2 {
816815

817816
@Override
818-
public void onTrimMemory(int level) {
819-
if (level >= TRIM_MEMORY_MODERATE) {
820-
YogaNodePool.get().clear();
821-
}
822-
}
817+
public void onTrimMemory(int level) {}
823818

824819
@Override
825820
public void onConfigurationChanged(Configuration newConfig) {}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/uimanager/YogaNodePool.kt

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)