New posts

This commit is contained in:
2026-11-06 21:43:48 +05:30
parent ecceaa8b32
commit f7b6c1efca
33 changed files with 1258 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
import java.lang.reflect.Field;
import sun.misc.Unsafe;
/** The classic way every library gets an Unsafe: read the private static field "theUnsafe". */
final class UnsafeAccess {
private UnsafeAccess() {}
static Unsafe get() {
try {
Field f = Unsafe.class.getDeclaredField("theUnsafe");
f.setAccessible(true);
return (Unsafe) f.get(null);
} catch (ReflectiveOperationException e) {
throw new IllegalStateException(e);
}
}
}