In our last example, we allocated memory simply, but as we saw the direct memory access (DMA) engine requires that our buffers be aligned to 4 KiB pages boundaries. If the buffers are not so aligned, which they likely will not be if they do not explicitly ask for it, then the runtime will copy the buffers so that their contents are aligned.
That is an expensive operation, but can we quantify how expensive? And how can we allocate aligned memory?