mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2025-06-09 19:36:47 +00:00
🆕 strlen函数
This commit is contained in:
parent
df7b3a3716
commit
a79315a31c
@ -86,3 +86,13 @@ static inline bool list_empty(struct List* entry)
|
||||
else return false;
|
||||
}
|
||||
|
||||
//计算字符串的长度(经过测试,该版本比采用repne/scasb汇编的运行速度快16.8%左右)
|
||||
static inline int strlen(char* s)
|
||||
{
|
||||
register int __res = 0;
|
||||
while (s[__res] != '\0')
|
||||
{
|
||||
++__res;
|
||||
}
|
||||
return __res;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user