mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-17 11:05:12 +00:00
Remove Nashorn Object Size of Dependency
This commit is contained in:
1 parent
f7ff4770d8
commit
323f19a539
2 files changed
+20
-6
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package noppes.npcs.util;
|
||||
|
||||
import java.lang.instrument.Instrumentation;
|
||||
|
||||
public class SizeOfObjectUtil {
|
||||
private static volatile Instrumentation instrumentation;
|
||||
|
||||
public static void initializeInstrumentation(Instrumentation inst) {
|
||||
instrumentation = inst;
|
||||
}
|
||||
|
||||
public static long sizeOfObject(Object obj) {
|
||||
if (instrumentation == null) {
|
||||
throw new IllegalStateException("Instrumentation is not initialized");
|
||||
}
|
||||
return instrumentation.getObjectSize(obj);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user