@JRubyMethod(name = "autorelease=", required = 1) public final IRubyObject autorelease(ThreadContext context, IRubyObject release) { if (autorelease != release.isTrue() && getMemoryIO() instanceof AllocatedDirectMemoryIO) { ((AllocatedDirectMemoryIO) getMemoryIO()).setAutoRelease(autorelease = release.isTrue()); } return context.nil; }
@JRubyMethod(name = "autorelease=", required = 1) public final IRubyObject autorelease(ThreadContext context, IRubyObject release) { if (autorelease != release.isTrue() && getMemoryIO() instanceof AllocatedDirectMemoryIO) { ((AllocatedDirectMemoryIO) getMemoryIO()).setAutoRelease(autorelease = release.isTrue()); } return context.nil; }
@JRubyMethod(name = "free") public final IRubyObject free(ThreadContext context) { if (getMemoryIO() instanceof AllocatedDirectMemoryIO) { ((AllocatedDirectMemoryIO) getMemoryIO()).free(); } else { throw context.runtime.newRuntimeError("cannot free non-allocated function"); } // Replace memory object with one that throws an exception on any access setMemoryIO(new FreedMemoryIO(context.runtime)); return context.nil; }
@JRubyMethod(name = "free") public final IRubyObject free(ThreadContext context) { if (getMemoryIO() instanceof AllocatedDirectMemoryIO) { ((AllocatedDirectMemoryIO) getMemoryIO()).free(); } else { throw context.runtime.newRuntimeError("cannot free non-allocated function"); } // Replace memory object with one that throws an exception on any access setMemoryIO(new FreedMemoryIO(context.runtime)); return context.nil; }
@JRubyMethod(name = "autorelease=", required = 1) public final IRubyObject autorelease(ThreadContext context, IRubyObject release) { if (autorelease != release.isTrue() && getMemoryIO() instanceof AllocatedDirectMemoryIO) { ((AllocatedDirectMemoryIO) getMemoryIO()).setAutoRelease(autorelease = release.isTrue()); } return context.runtime.getNil(); }
@JRubyMethod(name = "autorelease=", required = 1) public final IRubyObject autorelease(ThreadContext context, IRubyObject release) { if (autorelease != release.isTrue() && getMemoryIO() instanceof AllocatedDirectMemoryIO) { ((AllocatedDirectMemoryIO) getMemoryIO()).setAutoRelease(autorelease = release.isTrue()); } return context.runtime.getNil(); }
@JRubyMethod(name = "free") public final IRubyObject free(ThreadContext context) { if (getMemoryIO() instanceof AllocatedDirectMemoryIO) { ((AllocatedDirectMemoryIO) getMemoryIO()).free(); } else { throw context.runtime.newRuntimeError("cannot free non-allocated function"); } // Replace memory object with one that throws an exception on any access setMemoryIO(new FreedMemoryIO(context.runtime)); return context.runtime.getNil(); }
@JRubyMethod(name = "free") public final IRubyObject free(ThreadContext context) { if (getMemoryIO() instanceof AllocatedDirectMemoryIO) { ((AllocatedDirectMemoryIO) getMemoryIO()).free(); } else { throw context.runtime.newRuntimeError("cannot free non-allocated function"); } // Replace memory object with one that throws an exception on any access setMemoryIO(new FreedMemoryIO(context.runtime)); return context.runtime.getNil(); }