Example #1
0
  @JRubyMethod(
      name = {"initialize"},
      visibility = PRIVATE)
  public IRubyObject initialize(ThreadContext context, IRubyObject type, IRubyObject address) {
    setMemoryIO(
        address instanceof Pointer
            ? ((Pointer) address).getMemoryIO()
            : Factory.getInstance()
                .wrapDirectMemory(context.runtime, RubyFixnum.num2long(address)));
    size = Long.MAX_VALUE;
    typeSize = calculateTypeSize(context, type);

    return this;
  }