C 64-bit Pointer Alignment

前端 未结 5 1030
野性不改
野性不改 2021-01-02 01:39

Are pointers on a 64-bit system still 4 byte aligned (similar to a double on a 32 bit system)? Or are they note 8 byte aligned?

For example, on a 64-bit system how

5条回答
  •  南方客
    南方客 (楼主)
    2021-01-02 02:19

    You would need to consult the documentation for the particular ABI you are interested in. For example, here is the System V ABI x86-64 architeture supplement - you can see on page 12 that pointers on this ABI are 8-byte aligned (so yes, the structure you show would be padded out to 16 bytes).

提交回复
热议问题