Ushering out strlcpy()
Ushering out strlcpy()
Posted Aug 26, 2022 20:47 UTC (Fri) by NYKevin (subscriber, #129325)In reply to: Ushering out strlcpy() by wtarreau
Parent article: Ushering out strlcpy()
> The only thing you'll miss then is the machine-specific optimizations that went into a number of C libraries for byte search, fill or move (which can be significant for strchr() or memset()).
strchr and memset are libc functions, so I interpreted "a number of C libraries" as meaning "libc, and possibly other libraries, but mostly libc." If libc has machine-specific optimizations, and Rust can emit libc calls into the LLVM IR (which can then be inlined if it is advantageous to do so), then what exactly is the problem? Most of the interesting libc functions have some sort of safe wrapper in the Rust stdlib, and the language also provides a full FFI for calling arbitrary C code, so I really don't see what disadvantage you're talking about here.
