Determining maximum possible alignment in C++

前端 未结 6 749
情歌与酒
情歌与酒 2021-01-31 18:58

Is there any portable way to determine what the maximum possible alignment for any type is?

For example on x86, SSE instructions require 16-byte alignm

6条回答
  •  無奈伤痛
    2021-01-31 19:25

    Allocating aligned memory is trickier than it looks - see for example Implementation of aligned memory allocation

提交回复
热议问题