container_of(ptr, type, member)
来源:互联网 发布:巨人网络福利待遇 编辑:程序博客网 时间:2024/05/10 05:42
446 #define container_of(ptr, type, member) ({ /
447 const typeof( ((type *)0)->member ) *__mptr = (ptr); /
448 (type *)( (char *)__mptr - offsetof(type,member) );})
成员变量对应的变量的地址 - 偏移
member:成员变量
ptr :成员变量对应的变量的地址.
container_of()思想:结构体成员变量对应的变量的地址 减去 在成员在结构体中的偏移 = 结构体首的首地址
参考博客
http://blog.csdn.net/goldfighter/article/details/7682313
0 0
- container_of(ptr, type, member)
- container_of(ptr, type, member)
- container_of(ptr, type, member)
- container_of(ptr, type, member)
- container_of(ptr, type, member)
- container_of(ptr, type, member)
- container_of(ptr, type, member)
- 浅析container_of(ptr, type, member)
- 浅析container_of(ptr, type, member)
- 浅析container_of(ptr, type, member)
- 浅析container_of(ptr, type, member)
- 浅析container_of(ptr, type, member)
- 浅析container_of(ptr, type, member)
- 浅析container_of(ptr, type, member)
- 浅析container_of(ptr, type, member)
- linux container_of(ptr, type, member)
- 浅析container_of(ptr, type, member)
- linux中container_of(ptr, type, member)
- word2vec学习笔记
- vs后期生产事件
- 手势冲突解决方案
- 《代码大全》之错误处理技术(Error-Handling Techniques)
- 【Linux运维入门】MongoDb启动报错:ERROR: child process failed, exited with error number xx
- container_of(ptr, type, member)
- Qt用QAxObject读取excel编译出错问题解决
- Unity3D面试题整合
- response.setContentType()的作用及参数
- Android APK签名介绍01
- 架构设计:系统间通信(19)——MQ:消息协议(上)
- Git学习笔记(二)
- 算法训练 字串统计
- win7 启动后内存占用达到99% 解决方案