return getTypeSize(ffi.callMethod(context, "type_size", sizeArg));
}
public static final int getTypeSize(ThreadContext context, IRubyObject sizeArg) {
final RubyModule ffi = context.getRuntime().fastGetModule("FFI");
final IRubyObject typeDefs = ffi.fastFetchConstant("TypeDefs");
final IRubyObject type = ((RubyHash) typeDefs).fastARef(sizeArg);
final int size = type != null && !type.isNil() ? getTypeSize(type) : 0;
return size > 0 ? size : callTypeSize(context, ffi, sizeArg);
}
}