链表

定义

// include/linux/types.h
struct list_head {
    struct list_head *next, *prev;
};

原理

linux内核中的链表,是使用了container_of宏实现的。如果对该宏有正确的把握,那么理解链表的实现就没有什么困难。至于链表的相关操作,只不过是API的调用罢了。

你可能感兴趣的:(链表)