有25匹马五条跑道,一条跑道一次只能跑一皮马,跑多少次可以选出跑最快的5匹马?
参考文章:
https://www.nowcoder.com/questionTerminal/e07d8e0df93b4f6b93a3fadbe72f2c7c
linux 中 malloc 底层实现
直接看这篇文章:
https://www.cnblogs.com/dongzhiquan/p/5621906.html
为什么要进行内存对齐?
主要可以从 兼容性 和 性能 进行分析,如果不进行内存对齐,可能会:
- 程序运行的慢
- 你的程序会死锁(lock up)
- 你的操作系统会崩溃
- 你的程序会悄无声息的失败,并且产生错误结果
参考 StackOverflow 上的问题:
https://stackoverflow.com/questions/381244/purpose-of-memory-alignment?r=SearchResults
具体文章可以去读 IBM 的文章:
https://developer.ibm.com/technologies/systems/articles/pa-dalign/
关注公众号 不会编程的程序圆 ,看更多干货
本文收录于【一起进大厂】项目:
https://gitee.com/superhandsomechuan/enter-the-factory-together
欢迎 star & 欢迎与我交流!