private Object[] initReferenceCache() { referenceCacheUpdater.compareAndSet(this, null, new Object[layout.getReferenceFieldCount()]); return referenceCache; }
private Object[] initReferenceCache() { referenceCacheUpdater.compareAndSet(this, null, new Object[layout.getReferenceFieldCount()]); return referenceCache; }
private Object[] initReferenceCache() { referenceCacheUpdater.compareAndSet(this, null, new Object[layout.getReferenceFieldCount()]); return referenceCache; }
private Object[] initReferenceCache() { referenceCacheUpdater.compareAndSet(this, null, new Object[layout.getReferenceFieldCount()]); return referenceCache; }
@JRubyMethod(name = "initialize_copy", visibility = PRIVATE) public IRubyObject initialize_copy(ThreadContext context, IRubyObject other) { if (other == this) { return this; } if (!(other instanceof Struct)) { throw context.runtime.newTypeError("not an instance of Struct"); } Struct orig = (Struct) other; memory = (AbstractMemory) orig.getMemory().slice(context.runtime, 0, layout.getSize()).dup(); if (orig.referenceCache != null) { referenceCache = new Object[layout.getReferenceFieldCount()]; System.arraycopy(orig.referenceCache, 0, referenceCache, 0, referenceCache.length); } setMemoryIO(memory.getMemoryIO()); return this; }
@JRubyMethod(name = "initialize_copy", visibility = PRIVATE) public IRubyObject initialize_copy(ThreadContext context, IRubyObject other) { if (other == this) { return this; } if (!(other instanceof Struct)) { throw context.runtime.newTypeError("not an instance of Struct"); } Struct orig = (Struct) other; memory = (AbstractMemory) orig.getMemory().slice(context.runtime, 0, layout.getSize()).dup(); if (orig.referenceCache != null) { referenceCache = new Object[layout.getReferenceFieldCount()]; System.arraycopy(orig.referenceCache, 0, referenceCache, 0, referenceCache.length); } setMemoryIO(memory.getMemoryIO()); return this; }
@JRubyMethod(name = "initialize_copy", visibility = PRIVATE) public IRubyObject initialize_copy(ThreadContext context, IRubyObject other) { if (other == this) { return this; } if (!(other instanceof Struct)) { throw context.runtime.newTypeError("not an instance of Struct"); } Struct orig = (Struct) other; memory = (AbstractMemory) orig.getMemory().slice(context.runtime, 0, layout.getSize()).dup(); if (orig.referenceCache != null) { referenceCache = new Object[layout.getReferenceFieldCount()]; System.arraycopy(orig.referenceCache, 0, referenceCache, 0, referenceCache.length); } setMemoryIO(memory.getMemoryIO()); return this; }
@JRubyMethod(name = "initialize_copy", visibility = PRIVATE) public IRubyObject initialize_copy(ThreadContext context, IRubyObject other) { if (other == this) { return this; } if (!(other instanceof Struct)) { throw context.runtime.newTypeError("not an instance of Struct"); } Struct orig = (Struct) other; memory = (AbstractMemory) orig.getMemory().slice(context.runtime, 0, layout.getSize()).dup(); if (orig.referenceCache != null) { referenceCache = new Object[layout.getReferenceFieldCount()]; System.arraycopy(orig.referenceCache, 0, referenceCache, 0, referenceCache.length); } setMemoryIO(memory.getMemoryIO()); return this; }