Breaking: Remove YGConfigGetInstanceCount (#1370)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1370 X-link: https://github.com/facebook/react-native/pull/39369 This was added in https://github.com/facebook/yoga/pull/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, similar to a global node instance count that was also previously removed. Reviewed By: rshest Differential Revision: D49131207 fbshipit-source-id: 58537ed635ed455ff065471bdf77061a4bf826f4
This commit is contained in:
committed by
Facebook GitHub Bot
parent
776065d7c7
commit
a2d3fc6a3c
@@ -172,8 +172,6 @@ YOGA_EXPORT void YGNodeMarkDirtyAndPropagateToDescendants(
|
|||||||
return resolveRef(node)->markDirtyAndPropagateDownwards();
|
return resolveRef(node)->markDirtyAndPropagateDownwards();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t gConfigInstanceCount = 0;
|
|
||||||
|
|
||||||
YOGA_EXPORT WIN_EXPORT YGNodeRef YGNodeNewWithConfig(const YGConfigRef config) {
|
YOGA_EXPORT WIN_EXPORT YGNodeRef YGNodeNewWithConfig(const YGConfigRef config) {
|
||||||
auto* node = new yoga::Node{resolveRef(config)};
|
auto* node = new yoga::Node{resolveRef(config)};
|
||||||
yoga::assertFatal(
|
yoga::assertFatal(
|
||||||
@@ -261,23 +259,17 @@ YOGA_EXPORT void YGNodeReset(YGNodeRef node) {
|
|||||||
resolveRef(node)->reset();
|
resolveRef(node)->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
YOGA_EXPORT int32_t YGConfigGetInstanceCount(void) {
|
|
||||||
return gConfigInstanceCount;
|
|
||||||
}
|
|
||||||
|
|
||||||
YOGA_EXPORT YGConfigRef YGConfigNew(void) {
|
YOGA_EXPORT YGConfigRef YGConfigNew(void) {
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
const YGConfigRef config = new yoga::Config(YGAndroidLog);
|
const YGConfigRef config = new yoga::Config(YGAndroidLog);
|
||||||
#else
|
#else
|
||||||
const YGConfigRef config = new yoga::Config(YGDefaultLog);
|
const YGConfigRef config = new yoga::Config(YGDefaultLog);
|
||||||
#endif
|
#endif
|
||||||
gConfigInstanceCount++;
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
YOGA_EXPORT void YGConfigFree(const YGConfigRef config) {
|
YOGA_EXPORT void YGConfigFree(const YGConfigRef config) {
|
||||||
delete resolveRef(config);
|
delete resolveRef(config);
|
||||||
gConfigInstanceCount--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
YOGA_EXPORT void YGNodeSetIsReferenceBaseline(
|
YOGA_EXPORT void YGNodeSetIsReferenceBaseline(
|
||||||
|
@@ -330,7 +330,6 @@ void YGConfigSetUseLegacyStretchBehaviour(
|
|||||||
// YGConfig
|
// YGConfig
|
||||||
WIN_EXPORT YGConfigRef YGConfigNew(void);
|
WIN_EXPORT YGConfigRef YGConfigNew(void);
|
||||||
WIN_EXPORT void YGConfigFree(YGConfigRef config);
|
WIN_EXPORT void YGConfigFree(YGConfigRef config);
|
||||||
WIN_EXPORT int32_t YGConfigGetInstanceCount(void);
|
|
||||||
|
|
||||||
WIN_EXPORT void YGConfigSetExperimentalFeatureEnabled(
|
WIN_EXPORT void YGConfigSetExperimentalFeatureEnabled(
|
||||||
YGConfigRef config,
|
YGConfigRef config,
|
||||||
|
Reference in New Issue
Block a user