/** * Read a reference at the given position * @param offset index into the reference array * @return */ protected Object readReference(long offset) { assert referenceMessageSize != 0 : "References are not in use"; // Is there a way to compute the element offset once and just // arithmetic? return UnsafeRefArrayAccess.lpElement(references, UnsafeRefArrayAccess.calcElementOffset(offset)); }
/** * Write a reference to the given position * @param offset index into the reference array * @param reference */ protected void writeReference(long offset, Object reference) { assert referenceMessageSize != 0 : "References are not in use"; // Is there a way to compute the element offset once and just // arithmetic? UnsafeRefArrayAccess.spElement(references, UnsafeRefArrayAccess.calcElementOffset(offset), reference); }
private void soCycleElement(E[] buffer, E e, int activeCycleIndex, int positionWithinCycle, int cycleLengthLog2) { final int indexInBuffer = calcElementIndexInBuffer(positionWithinCycle, activeCycleIndex, cycleLengthLog2); final long offset = UnsafeRefArrayAccess.calcElementOffset(indexInBuffer); soElement(buffer, offset, e); }