技术栈

rt_container_of

诗丶远方的田筠
3 个月前
算法·list·rt_list_entry·rt_container_of
在 rtthread中,rt_list_entry (rt_container_of) 已知结构体成员的地址,反推出结构体的首地址rt_list_entry (rt_container_of)宏定义:将 rt_container_of: ((type *)((char *)(ptr) - (unsigned long)(&((type *)0)->member)))