Why double in C is 8 bytes aligned?

后端 未结 4 1442
时光说笑
时光说笑 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:50

    Refer this wiki article about double precision floating point format

    The number of memory cycles depends on your hardware architecture which determines how many RAM banks you have. If you have a 32-bit architecture and 4 RAM banks, you need only 2 memory cycle to read.(Each RAM bank contributing 1 byte)

提交回复
热议问题