From 1e0ebdae2fe16349bbaaf42214e5c4db93712cb2 Mon Sep 17 00:00:00 2001 From: David Aurelio Date: Fri, 3 May 2019 05:51:37 -0700 Subject: [PATCH] Remove API to constrain measure cache size Summary: We conducted an experiment with different measure cache sizes. This has now been deallocatedi (D15183473). Remove the necessary APIs. Reviewed By: SidharthGuglani Differential Revision: D15183486 fbshipit-source-id: a38fa5a3ab0321c2521265f7d1cd6b495efd76cf --- yoga/Yoga-internal.h | 2 -- yoga/Yoga.cpp | 11 +---------- 2 files changed, 1 insertion(+), 12 deletions(-) diff --git a/yoga/Yoga-internal.h b/yoga/Yoga-internal.h index a5cf3037..dffb8672 100644 --- a/yoga/Yoga-internal.h +++ b/yoga/Yoga-internal.h @@ -29,8 +29,6 @@ void YGNodeCalculateLayoutWithContext( YGDirection ownerDirection, void* layoutContext); -void YGSetUsedCachedEntries(size_t); - YG_EXTERN_C_END namespace facebook { diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index 6a394971..f3f68fd0 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -28,15 +28,6 @@ __forceinline const float fmaxf(const float a, const float b) { using namespace facebook::yoga; using detail::Log; -namespace { -size_t usedMeasureCacheEntries = YG_MAX_CACHED_RESULT_COUNT; -} - -void YGSetUsedCachedEntries(size_t n) { - usedMeasureCacheEntries = - n == 0 || n > YG_MAX_CACHED_RESULT_COUNT ? YG_MAX_CACHED_RESULT_COUNT : n; -} - #ifdef ANDROID static int YGAndroidLog( const YGConfigRef config, @@ -3864,7 +3855,7 @@ bool YGLayoutNodeInternal( layoutMarkerData.maxMeasureCache = layout->nextCachedMeasurementsIndex + 1; } - if (layout->nextCachedMeasurementsIndex == usedMeasureCacheEntries) { + if (layout->nextCachedMeasurementsIndex == YG_MAX_CACHED_RESULT_COUNT) { if (gPrintChanges) { Log::log(node, YGLogLevelVerbose, nullptr, "Out of cache entries!\n"); }