Displaying 1 result from an estimated 1 matches for "7f550a7bd9d7".
2010 Aug 10
1
Why p_strdup and other string functions uses loops instead strlen? (dovecot 2.0.rc4)
I did Dovecot profiling on huge e-mail system, and p_strdup was very
high on list.
I do minor change:
p_strdup:
/*
for (len = 0; (str)[len] != '\0'; )
len++;
len++;
*/
len = strlen(str) + 1;
p_strndup:
/*
len = 0;
while (len < max_chars && ((const char *) str)[len] != '\0')
len++;
*/
len = strnlen(str, max_chars);
And after changes strdup drop down on the