Why doesn't GCC optimize structs?

前端 未结 7 1345
耶瑟儿~
耶瑟儿~ 2020-11-28 05:58

Systems demand that certain primitives be aligned to certain points within the memory (ints to bytes that are multiples of 4, shorts to bytes that are multiples of 2, etc.).

7条回答
  •  春和景丽
    2020-11-28 06:48

    You might want to try the latest gcc trunk or, struct-reorg-branch which is under active development.

    https://gcc.gnu.org/wiki/cauldron2015?action=AttachFile&do=view&target=Olga+Golovanevsky_+Memory+Layout+Optimizations+of+Structures+and+Objects.pdf

提交回复
热议问题