示例#1
0
        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);
        }
示例#2
0
 private void PutInt(long p, int value)
 {
     if (UnsafeUtil.allowUnalignedMemoryAccess)
     {
         UnsafeUtil.putInt(p, value);
     }
     else
     {
         UnsafeUtil.putIntByteWiseLittleEndian(p, value);
     }
 }
示例#3
0
 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);
         }
     }
 }
示例#4
0
 public override void Set(long index, int value)
 {
     UnsafeUtil.putInt(AddressOf(index), value);
 }