示例#1
0
        public override void Set3ByteInt(long index, int offset, int value)
        {
            long address = address(index, offset);

            UnsafeUtil.putShort(address, ( short )value);
            UnsafeUtil.putByte(address + Short.BYTES, ( sbyte )(( int )(( uint )value >> (sizeof(short) * 8))));
        }
示例#2
0
        public override void Set5ByteLong(long index, int offset, long value)
        {
            long address = address(index, offset);

            PutInt(address, ( int )value);
            UnsafeUtil.putByte(address + Integer.BYTES, ( sbyte )(( long )(( ulong )value >> 32)));
        }
示例#3
0
        public override void Set(long index, sbyte[] value)
        {
            long address = address(index, 0);

            for (int i = 0; i < itemSize; i++, address++)
            {
                UnsafeUtil.putByte(address, value[i]);
            }
        }
示例#4
0
        public override void Clear()
        {
            if (IsByteUniform(_defaultValue))
            {
                UnsafeUtil.setMemory(Address, LengthConflict * itemSize, _defaultValue[0]);
            }
            else
            {
                long intermediary = UnsafeUtil.allocateMemory(itemSize, AllocationTracker);
                for (int i = 0; i < _defaultValue.Length; i++)
                {
                    UnsafeUtil.putByte(intermediary + i, _defaultValue[i]);
                }

                for (long i = 0, adr = Address; i < LengthConflict; i++, adr += itemSize)
                {
                    UnsafeUtil.copyMemory(intermediary, adr, itemSize);
                }
                UnsafeUtil.free(intermediary, itemSize, AllocationTracker);
            }
        }
示例#5
0
 private void PutByte(long p, sbyte value)
 {
     UnsafeUtil.putByte(p, value);
 }
示例#6
0
 public override void SetByte(long index, int offset, sbyte value)
 {
     UnsafeUtil.putByte(Address(index, offset), value);
 }