【发布时间】:2020-06-30 12:26:00
【问题描述】:
我有一个 64 位结构数组,我想在 64 位边界上对齐:
struct AStruct
{
int x;
int y;
};
std::array<AStruct, 1000> array; // I'd like to align this on 64-bit boundary
我知道属性是__attribute__((__aligned__(64)),但我不确定是否需要对齐每个单独的结构、整个数组或为两者指定属性?
编译器是 Clang
【问题讨论】:
标签: c++ memory-alignment