结构的填充使用 [英] Use of struct padding
本文介绍了结构的填充使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
什么是C中的使用填充结构的?
What is the use of padding struct in C?
推荐答案
一些体系将有更好的表现,如果仅仅对齐访问制成,所以把32位对象在32位的边界,并在64位64位对象边界可以提高应用程序的速度。
Some architectures will perform better if only aligned accesses are made, so putting 32-bit objects on 32-bit boundaries, and 64-bit objects on 64-bit boundaries can improve the speed of your application.
在某些平台是完全不能作出不对齐访问的,并在这些架构不填充可以是一个真正的灾难。
Some architectures are completely incapable of making unaligned accesses, and on those architectures not padding can be a real disaster.
这篇关于结构的填充使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文