Why double in C is 8 bytes aligned?

后端 未结 4 1440
时光说笑
时光说笑 2020-12-03 17:08

I was reading a article about data types alignment in memory(here) and I am unable to understand one point i.e.

Note that a double variable will be al

4条回答
  •  长情又很酷
    2020-12-03 17:46

    8 byte alignment for double on 32 bit architecture doesn't reduce memory reads but it still improve performance of the system in terms of reduced cache access. Please read the following : https://stackoverflow.com/a/21220331/5038027

提交回复
热议问题