[PATCH 3/3] resolv: Optimize inet_ntop

Florian Weimer fweimer@redhat.com
Wed Jun 4 17:08:23 GMT 2025


* Adhemerval Zanella Netto:

>> The words copy shouldn't really be needed, GCC can usually combine two
>> byte accesses into single 16-bit loads.
>
> There is no need for the words array in fact, we can ntohs when
> accessing the s6_addr16 for source (and on most chips it should be
> lowered efficiently).

I believe this introduces an alignment requirement that the inet_ntop
specification does not actually provide.

Thanks,
Florian



More information about the Libc-alpha mailing list