linux 泛型链表
时间: 2023-09-26 14:05:43 浏览: 115
Linux内核中的泛型链表是通过使用struct list_head来实现的。这个链表是一个循环双向结构,可以在链表的任意位置插入、删除和遍历节点。struct list_head定义在<LinuxList.h>头文件中,这个头文件提供了相关的增删改查API。它还依赖于其他头文件,包括<linux/types.h>、<linux/stddef.h>、<linux/poison.h>和<linux/prefetch.h>。这个链表的实现使用了GNU扩展的语法,如typeof关键字和双括号语法。如果需要在不支持GNU的平台上使用Linux内核链表,可以移除这些扩展语法并省略prefetch()函数,这不会影响链表的正常使用,只会增加一些调用时的安全风险。
阅读全文
相关推荐
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20241231044930.png)
![docx](https://img-home.csdnimg.cn/images/20241231044901.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231044930.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)
![-](https://img-home.csdnimg.cn/images/20241231045053.png)