mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Add Unsafe based storage backend
Summary: @public Adds another version of property storage for `YogaNode`, using `sun.misc.Unsafe`. Adopts the stub concept from Litho for `Unsafe`, as it is hidden by the Android SDK. Reviewed By: pasqualeanatriello Differential Revision: D9140103 fbshipit-source-id: a4b376eca341b724a00f873467ae8bf8eaac69f4
This commit is contained in:
1 parent
1d93d70af4
commit
73d5746122
12 files changed
+670
-13
No files matched your search
@@ -23,6 +23,7 @@ public class YogaNode implements Cloneable {
|
||||
|
||||
public static final int BYTE_BUFFER = 1;
|
||||
public static final int HYBRID = 2;
|
||||
public static final int UNSAFE = 3;
|
||||
|
||||
/** Get native instance count. Useful for testing only. */
|
||||
static native int jni_YGNodeGetInstanceCount();
|
||||
@@ -50,6 +51,9 @@ public class YogaNode implements Cloneable {
|
||||
case HYBRID:
|
||||
mDelegate = new YogaNodePropertiesHybrid(this);
|
||||
break;
|
||||
case UNSAFE:
|
||||
mDelegate = new YogaNodePropertiesUnsafe(this);
|
||||
break;
|
||||
default:
|
||||
mDelegate = new YogaNodePropertiesJNI(this);
|
||||
}
|
||||
@@ -63,6 +67,9 @@ public class YogaNode implements Cloneable {
|
||||
case HYBRID:
|
||||
mDelegate = new YogaNodePropertiesHybrid(this, config);
|
||||
break;
|
||||
case UNSAFE:
|
||||
mDelegate = new YogaNodePropertiesUnsafe(this, config);
|
||||
break;
|
||||
default:
|
||||
mDelegate = new YogaNodePropertiesJNI(this, config);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user