private void CheckAlignment(IntPtr segment) { if((segment.ToInt64() & 7) != 0) { throw new ArgumentException(string.Format("Segment address has to be aligned to 8 bytes, but it is 0x{0:X}.", segment)); } }