Dealloc JNI implementation experiment

Summary:
@public

Remove ability to configure Yoga to run with/without JNI fast calls on dalvik / art.
This switches to always run with fast calls.

Reviewed By: astreet

Differential Revision: D13144652

fbshipit-source-id: 091aab0cd1290d46346323d3e26a11dd0bb17187
This commit is contained in:
David Aurelio
2018-11-22 03:59:22 -08:00
committed by Facebook Github Bot
parent 8d5bbecd3d
commit 339c5574b8
4 changed files with 106 additions and 156 deletions

View File

@@ -8,6 +8,7 @@
package com.facebook.yoga;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.soloader.SoLoader;
@DoNotStrip
public class YogaConfig {
@@ -15,7 +16,7 @@ public class YogaConfig {
public static int SPACING_TYPE = 1;
static {
YogaJNI.init();
SoLoader.loadLibrary("yoga");
}
long mNativePointer;

View File

@@ -1,32 +0,0 @@
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
package com.facebook.yoga;
import com.facebook.soloader.SoLoader;
public class YogaJNI {
private static boolean isInitialized = false;
// Known constants. 1-3 used in previous experiments. Do not reuse.
public static int JNI_FAST_CALLS = 4;
// set before loading any other Yoga code
public static boolean useFastCall = false;
private static native void jni_bindNativeMethods(boolean useFastCall);
static synchronized boolean init() {
if (!isInitialized) {
isInitialized = true;
SoLoader.loadLibrary("yoga");
jni_bindNativeMethods(useFastCall);
return true;
}
return false;
}
}

View File

@@ -8,6 +8,7 @@
package com.facebook.yoga;
import com.facebook.proguard.annotations.DoNotStrip;
import com.facebook.soloader.SoLoader;
import java.util.ArrayList;
import java.util.List;
import javax.annotation.Nullable;
@@ -16,7 +17,7 @@ import javax.annotation.Nullable;
public class YogaNode implements Cloneable {
static {
YogaJNI.init();
SoLoader.loadLibrary("yoga");
}
/**