Implement stride, generalize copy operations while checking memory layout