Skip to content

Commit

Permalink
Fix 'global reference table overflow' error in Fabric
Browse files Browse the repository at this point in the history
Summary: This diff ensures that the 'measure' method in TextLayoutManager is memoized using a static variable.

Reviewed By: fkgozali

Differential Revision: D13585508

fbshipit-source-id: 9275a4d193b8abb0c3aaffd5a5535234717475e1
  • Loading branch information
mdvacca authored and facebook-github-bot committed Jan 5, 2019
1 parent a3df286 commit 9380ec0
Showing 1 changed file with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ Size TextLayoutManager::measure(
contextContainer_->getInstance<jni::global_ref<jobject>>(
"FabricUIManager");

auto clazz =
jni::findClassStatic("com/facebook/fbreact/fabric/FabricUIManager");
static auto measure = clazz->getMethod<jlong(
jstring,
ReadableNativeMap::javaobject,
ReadableNativeMap::javaobject,
jint,
jint,
jint,
jint)>("measure");
static auto measure =
jni::findClassStatic("com/facebook/fbreact/fabric/FabricUIManager")
->getMethod<jlong(
jstring,
ReadableNativeMap::javaobject,
ReadableNativeMap::javaobject,
jint,
jint,
jint,
jint)>("measure");

auto minimumSize = layoutConstraints.minimumSize;
auto maximumSize = layoutConstraints.maximumSize;
Expand Down

0 comments on commit 9380ec0

Please sign in to comment.