69,335
社区成员
发帖
与我相关
我的任务
分享
783 #define container_of(ptr, type, member) ({ \
784 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
785 (type *)( (char *)__mptr - offsetof(type,member) );})
786
linux核心的类似用法。
int指针占用4B,加上4,就是偏移4*4=16B,取其整数