public void removeFinalizers(long id) { IRubyObject object = id2ref(id); if (object != null) { object.removeFinalizers(); } }
public void removeFinalizers(long id) { IRubyObject object = id2ref(id); if (object != null) { object.removeFinalizers(); } }
public void removeFinalizers(long id) { IRubyObject object = id2ref(id); if (object != null) { object.removeFinalizers(); } }
public void removeFinalizers(long id) { IRubyObject object = id2ref(id); if (object != null) { object.removeFinalizers(); } }
@JRubyMethod(name = "_id2ref", required = 1, module = true, visibility = PRIVATE) public static IRubyObject id2ref(IRubyObject recv, IRubyObject id) { final Ruby runtime = id.getRuntime(); if (!(id instanceof RubyFixnum)) { throw runtime.newTypeError(id, runtime.getFixnum()); } long longId = ((RubyFixnum) id).getLongValue(); if (longId == 0) { return runtime.getFalse(); } else if (longId == 20) { return runtime.getTrue(); } else if (longId == 8) { return runtime.getNil(); } else if (longId % 2 != 0) { // odd return runtime.newFixnum((longId - 1) / 2); } else { if (runtime.isObjectSpaceEnabled()) { IRubyObject object = runtime.getObjectSpace().id2ref(longId); if (object == null) { return runtime.getNil(); } return object; } else { runtime.getWarnings().warn("ObjectSpace is disabled; _id2ref only supports immediates, pass -X+O to enable"); throw runtime.newRangeError(String.format("0x%016x is not id value", longId)); } } }
@JRubyMethod(name = "_id2ref", required = 1, module = true, visibility = PRIVATE) public static IRubyObject id2ref(IRubyObject recv, IRubyObject id) { final Ruby runtime = id.getRuntime(); if (!(id instanceof RubyFixnum)) { throw runtime.newTypeError(id, runtime.getFixnum()); } long longId = ((RubyFixnum) id).getLongValue(); if (longId == 0) { return runtime.getFalse(); } else if (longId == 20) { return runtime.getTrue(); } else if (longId == 8) { return runtime.getNil(); } else if (longId % 2 != 0) { // odd return runtime.newFixnum((longId - 1) / 2); } else { if (runtime.isObjectSpaceEnabled()) { IRubyObject object = runtime.getObjectSpace().id2ref(longId); if (object == null) { return runtime.getNil(); } return object; } else { runtime.getWarnings().warn("ObjectSpace is disabled; _id2ref only supports immediates, pass -X+O to enable"); throw runtime.newRangeError(String.format("0x%016x is not id value", longId)); } } }
} else { if (runtime.isObjectSpaceEnabled()) { IRubyObject object = runtime.getObjectSpace().id2ref(longId); if (object == null) { return runtime.getNil();
} else { if (runtime.isObjectSpaceEnabled()) { IRubyObject object = runtime.getObjectSpace().id2ref(longId); if (object == null) { return runtime.getNil();