Add PlatformDependent* methods that are needed by io_uring (#10744)

Motivation:

ddebc10 added a few adjustments that are needed by io_uring that we will add as an incubator repository. Unfortunally we missed the changed in PlatformDependent*.

Modifications:

Add missing methods

Result:

Be able to compile io_uring code against core netty
This commit is contained in:
Norman Maurer 2020-10-28 19:20:52 +01:00 committed by GitHub
parent ddebc1027d
commit d4defc30b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -503,6 +503,14 @@ public final class PlatformDependent {
return PlatformDependent0.getInt(object, fieldOffset);
}
public static int getIntVolatile(long address) {
return PlatformDependent0.getIntVolatile(address);
}
public static void putIntOrdered(long adddress, int newValue) {
PlatformDependent0.putIntOrdered(adddress, newValue);
}
public static byte getByte(long address) {
return PlatformDependent0.getByte(address);
}

View File

@ -562,6 +562,14 @@ final class PlatformDependent0 {
return UNSAFE.getInt(data, INT_ARRAY_BASE_OFFSET + INT_ARRAY_INDEX_SCALE * index);
}
static int getIntVolatile(long address) {
return UNSAFE.getIntVolatile(null, address);
}
static void putIntOrdered(long adddress, int newValue) {
UNSAFE.putOrderedInt(null, adddress, newValue);
}
static long getLong(byte[] data, int index) {
return UNSAFE.getLong(data, BYTE_ARRAY_BASE_OFFSET + index);
}