container_of函数和list_entry函数
来源:互联网 发布:简便算法计算器 编辑:程序博客网 时间:2024/05/19 16:05
container_of函数:根据指向type类型结构体中的一个member成员变量的ptr指针,返回type类型结构的指针
代码:
#ifndef container_of
#define container_of(ptr, type, member) ({ \
const typeof(((type *)0)->member) * __mptr = (ptr);\
(type *)((char *)__mptr - offsetof(type, member)); })
#endif
list_entry函数:和container_of函数一样
代码:
#define list_entry(ptr, type, member) \
container_of(ptr, type, member)
阅读全文
0 0
- container_of函数和list_entry函数
- Linux中的list_entry和container_of
- list_entry , container_of
- container_of()和内核链表中的list_entry()
- container_of()和内核链表中的list_entry()
- container_of 函数
- container_of 函数
- container_of函数
- container_of 函数
- list_for_each_entry/list_entry/container_of
- list_entry()等价于container_of()
- 内核链表中list_entry()函数
- container_of函数原理分析
- container_of函数原理分析
- 关于container_of和list_for_each_entry 及其相关函数的分析
- 关于container_of和list_for_each_entry 及其相关函数的分析
- 关于container_of和list_for_each_entry 及其相关函数的分析
- 关于container_of和list_for_each_entry 及其相关函数的分析
- HashMap源码分析
- osg mingw 编译 带版本号
- hadoop命令 -- job相关
- Windows -cmd:ipconfig
- PHP学习笔记2-php基础语法
- container_of函数和list_entry函数
- UnityShader
- 字符编码
- Oracle学习笔记day05——SQL概述
- Redis--Replication(复制)
- 【javascript】cookie和session
- C++堆和栈的比较
- 各运算符的优先级别 -- JAVA 基础
- 8月17日云栖精选夜读:用户体验再掀高潮,阿里云域名领跑用户体验