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:
David Aurelio
2018-08-05 16:36:09 -07:00
committed by Facebook Github Bot
parent c5d4485db3
commit be78bfbd8c
10 changed files with 682 additions and 11 deletions

10
java/stubs/build.gradle Normal file
View File

@@ -0,0 +1,10 @@
apply plugin: 'java'
sourceSets {
main {
java {
srcDirs = ['src']
}
}
}

View File

@@ -0,0 +1,27 @@
/*
* Copyright (c) 2018-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the LICENSE
* file in the root directory of this source tree.
*
*/
package sun.misc;
/**
* Stub for sun.misc.Unsafe, which is not exposed by the Android SDK.
*
* This only contains the methods and fields we need for Yoga.
*/
public final class Unsafe {
private static final Unsafe theUnsafe = null;
public final int getInt(Object object, long offset) {
throw new RuntimeException("Stub!");
}
public final void putInt(Object object, long offset, int value) {
throw new RuntimeException("Stub!");
}
}