protected internal override void InternalPut(long keyAddress, long key, VALUE value) { assert(int) key == key : "Illegal key " + key + ", it's bigger than int"; // We can "safely" cast to int here, assuming that this call trickles in via a PrimitiveIntCollection UnsafeUtil.putInt(keyAddress, ( int )key); }
private void PutInt(long p, int value) { if (UnsafeUtil.allowUnalignedMemoryAccess) { UnsafeUtil.putInt(p, value); } else { UnsafeUtil.putIntByteWiseLittleEndian(p, value); } }
public override void Clear() { if (IsByteUniform(_defaultValue)) { UnsafeUtil.setMemory(address, length << Shift, ( sbyte )_defaultValue); } else { for (long i = 0, adr = address; i < length; i++, adr += itemSize) { UnsafeUtil.putInt(adr, _defaultValue); } } }
public override void Set(long index, int value) { UnsafeUtil.putInt(AddressOf(index), value); }