MemSwap performs memory copy of specified bytes from src to dst
(dst unsafe.Pointer, src unsafe.Pointer, bytes int)
| 45 | |
| 46 | // MemSwap performs memory copy of specified bytes from src to dst |
| 47 | func MemSwap(dst unsafe.Pointer, src unsafe.Pointer, bytes int) { |
| 48 | for i := 0; i < bytes; i++ { |
| 49 | tmp := *(*uint8)(MemAccess(dst, i)) |
| 50 | *(*uint8)(MemAccess(dst, i)) = *(*uint8)(MemAccess(src, i)) |
| 51 | *(*uint8)(MemAccess(src, i)) = tmp |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | // MemCmp performs memory comparison between two memory location start from offset |
| 56 | // comparing bytes byte while skip offset byte |
no test coverage detected