protected int getArgumentNativeStackSize(Class cls) { if (NativeMapped.class.isAssignableFrom(cls)) { cls = NativeMappedConverter.getInstance(cls).nativeType(); } if (cls.isArray()) { return Pointer.SIZE; } try { return Native.getNativeSize(cls); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Unknown native stack allocation size for " + cls); } }