Vetting the cargo
Vetting the cargo
Posted Jun 12, 2022 15:52 UTC (Sun) by mpr22 (subscriber, #60784)In reply to: Vetting the cargo by khim
Parent article: Vetting the cargo
That architecture-specific assembly language implementation which is aggressively optimized for performance on large strings rather than readability or ease of implementation was, I am sure, quite challenging to implement, but this falls into the realm of "accidental challenge arising from the chosen method of implementation" rather than "essential challenge arising from the specification".
A naïve compliant implementation of strlen() in native C, on the other hand, is in the realms of "too trivial to copyright":
size_t strlen(const char *s) {
size_t len;
for (len = 0u; s[len]; ++len) {
/* do nothing */
}
return len;
}
The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:
Note: you can avoid this step in the future by logging into your LWN account.
