Currently, calling AllocObject or Unsafe.allocateInstance with a primitive type (e.g. unsafe.allocateInstance(int.class)) leads to a segmentation fault because Classes representing primitive types do not have an associated Klass.
While AllocObject or allocateInstance should in principle never be called with a Class representing a primitive, it should probably not crash in such a case since it throws sensible exceptions for many other invalid arguments (interfaces, abstract types, arrays, j.l.Class).
While AllocObject or allocateInstance should in principle never be called with a Class representing a primitive, it should probably not crash in such a case since it throws sensible exceptions for many other invalid arguments (interfaces, abstract types, arrays, j.l.Class).