边界对齐是指编辑C++时在使用结构体指针,进行C#和C++的互相调用。边界对齐是一个大问题,因为边界对齐问题,结构体的成员并不是顺序在内存一个挨着一个的排序。
align 操作告诉编译器按特定的边界对齐下一个指令或声明。
The .align operation tells the assembler to align the next instruction or declaration at a certain boundary.
在其他情况下,它可能会将内存地址与实际硬件边界对齐以优化性能。
In other cases it might align their memory addresses to natural hardware boundaries to optimize performance.
注意所有声明的变量(使用 DMA 复制的)都是按四字边界对齐的且都是四字的整数倍。
Note that all of the declared variables which will be copied using DMA are aligned on quadword boundaries and are multiples of quadwords.
应用推荐