C語言中的static inline

今天開始看Redis的源碼,其中在最簡單的數據結構SDS(Simple Dynamic String)的頭文件中聲明瞭如下的函數數據結構 static inline size_t sdslen(const sds s) { struct sdshdr *sh = (void*)(s-(sizeof(struct sdshdr))); return sh->len; } 看到這段代碼
相關文章
相關標籤/搜索