Skip to content

Commit 036dd3c

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Breaking: Remove YGConfigGetInstanceCount
Summary: This was added in facebook/yoga#497 specifically for tests related to memory leaks in the C# bindings to count how often YGConfigFree. This is the wrong layer for this check, we don't have officially supported C# bindings anymore, and this API is not safe when Yoga runs on multiple threads. This removes it. Differential Revision: D49131207 fbshipit-source-id: da60f5bafe667cbec8e5a2e495238b6732a702ef
1 parent ba8d7df commit 036dd3c

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

packages/react-native/ReactCommon/yoga/yoga/Yoga.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,6 @@ YOGA_EXPORT void YGNodeMarkDirtyAndPropagateToDescendants(
172172
return resolveRef(node)->markDirtyAndPropagateDownwards();
173173
}
174174

175-
int32_t gConfigInstanceCount = 0;
176-
177175
YOGA_EXPORT WIN_EXPORT YGNodeRef YGNodeNewWithConfig(const YGConfigRef config) {
178176
auto* node = new yoga::Node{resolveRef(config)};
179177
yoga::assertFatal(
@@ -261,23 +259,17 @@ YOGA_EXPORT void YGNodeReset(YGNodeRef node) {
261259
resolveRef(node)->reset();
262260
}
263261

264-
YOGA_EXPORT int32_t YGConfigGetInstanceCount(void) {
265-
return gConfigInstanceCount;
266-
}
267-
268262
YOGA_EXPORT YGConfigRef YGConfigNew(void) {
269263
#ifdef ANDROID
270264
const YGConfigRef config = new yoga::Config(YGAndroidLog);
271265
#else
272266
const YGConfigRef config = new yoga::Config(YGDefaultLog);
273267
#endif
274-
gConfigInstanceCount++;
275268
return config;
276269
}
277270

278271
YOGA_EXPORT void YGConfigFree(const YGConfigRef config) {
279272
delete resolveRef(config);
280-
gConfigInstanceCount--;
281273
}
282274

283275
YOGA_EXPORT void YGNodeSetIsReferenceBaseline(

packages/react-native/ReactCommon/yoga/yoga/Yoga.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ void YGConfigSetUseLegacyStretchBehaviour(
330330
// YGConfig
331331
WIN_EXPORT YGConfigRef YGConfigNew(void);
332332
WIN_EXPORT void YGConfigFree(YGConfigRef config);
333-
WIN_EXPORT int32_t YGConfigGetInstanceCount(void);
334333

335334
WIN_EXPORT void YGConfigSetExperimentalFeatureEnabled(
336335
YGConfigRef config,

0 commit comments

Comments
 (0)