public static void MemorySet(Pointer dest, ushort value, uint count) { // FUTURE: Improve for (int i = 0; i < count; i += 2) { dest.Store16(i, value); } }
public static void MemorySet(Pointer dest, ushort value, uint count) { uint value32 = (uint)(value << 16 | value << 0); uint count32 = count >> 1; for (uint i = 0; i < count32; i++) { dest.Store32(i << 1, value32); } uint count16 = count & 0x01; for (uint i = 0; i < count16; i++) { dest.Store16(count32 + i, value); } }