美文网首页Linux
Linux内核设计与实现学习笔记-内核数据结构01

Linux内核设计与实现学习笔记-内核数据结构01

作者: YeZhou | 来源:发表于2016-04-25 10:42 被阅读113次

Linux的内核实现了一些经典的数据结构,看内核代码学习数据结构,避免自己造轮子。

内核实现的主要数据结构如下:
链表
队列
映射
二叉树


1. 链表

链表声明在内核的头文件<linux/list.h>中,结构如下:
struct list_head{ struct list_head *next; struct list_head *prev; }

struct fox{ unsigned long tail_length; unsigned long weight; bool is_fantastic; struct list_head list; }

内核中链表的实现和平时不太一样,内核中是根据链表直针来寻找父结构的。

相关文章

网友评论

    本文标题:Linux内核设计与实现学习笔记-内核数据结构01

    本文链接:https://www.haomeiwen.com/subject/huofrttx.html