11 2018 档案
转:do{...}while(0)的意义和用法
摘要:http://www.spongeliu.com/415.html 转:do{...}while(0)的意义和用法 linux内核和其他一些开源的代码中,经常会遇到这样的代码: do{ ... }while(0) do{ ... }while(0) 这样的代码一看就不是一个循环,do..while表 阅读全文
posted @ 2018-11-25 20:37 lxbkylx 阅读(180) 评论(0) 推荐(0)
转:快速判断一个32位的字中是否存在值为"0"的byte
摘要:http://www.spongeliu.com/421.html 首先为什么要做这样的判断呢? 当你要strcpy活着strcmp或者hash一个字符串的时候,传统的方法是每个byte进行比较。以strcpy为例,当一个字符串比较长,我们用32(或者64位)的字长进行copy的话,一次拷贝会拷贝4 阅读全文
posted @ 2018-11-23 11:57 lxbkylx 阅读(526) 评论(0) 推荐(0)
转:内存对齐
摘要:内存对齐 内存对齐”应该是编译器的“管辖范围”。编译器为程序中的每个“数据单元”安排在适当的位置上。但是C语言的一个特点就是太灵活,太强大,它允许你干预“内存对齐”。如果你想了解更加底层的秘密,“内存对齐”对你就不应该再透明了。 内存对齐”应该是编译器的“管辖范围”。编译器为程序中的每个“数据单元” 阅读全文
posted @ 2018-11-23 11:35 lxbkylx 阅读(236) 评论(0) 推荐(0)
摘:C语言操作符优先级
摘要:sizeof 类型 sizeof(rexp) 摘自《C和指针》 阅读全文
posted @ 2018-11-17 11:50 lxbkylx 阅读(198) 评论(2) 推荐(1)
摘:memcpy的实现
摘要:摘:memcpy的实现 https://baike.baidu.com/item/memcpy/659918?fr=aladdin 2018-11-08 汇编部分没有看懂。 阅读全文
posted @ 2018-11-08 16:39 lxbkylx 阅读(154) 评论(0) 推荐(0)
转:C语言:error: a label can only be part of a statement and a declaration is not a statement|
摘要:转: C语言:error: a label can only be part of a statement and a declaration is not a statement| 原文:https://blog.csdn.net/qq_30242609/article/details/52858 阅读全文
posted @ 2018-11-01 20:01 lxbkylx 阅读(1057) 评论(0) 推荐(0)