bind9/lib
Ondřej Surý 03ed19cf71
Refactor the common buffer manipulation in rdataslab.c in macros
The rdataslab.c was full of code like this:

        length = raw[0] * 256 + raw[1];

and

        count2 = *current2++ * 256;
        count2 += *current2++;

Refactor code like this into peek_uint16() and get_uint16 macros
to prevent code repetition and possible mistakes when copy and
pasting the same code over and over.

As a side note for an entertainment of a careful reader of the commit
messages: The byte manipulation was changed from multiplication and
addition to shift with or.

The difference in the assembly looks like this:

MUL and ADD:

	movzx   eax, BYTE PTR [rdi]
        movzx   edi, BYTE PTR [rdi+1]
        sal     eax, 8
        or      edi, eax

SHIFT and OR:

        movzx   edi, WORD PTR [rdi]
        rol     di, 8
        movzx   edi, di

If the result and/or buffer is then being used after the macro call,
there's more differences in favor of the SHIFT+OR solution.
2024-05-24 09:52:45 +02:00
..
dns Refactor the common buffer manipulation in rdataslab.c in macros 2024-05-24 09:52:45 +02:00
isc fix typing mistakes in trace macros 2024-05-17 18:11:23 -07:00
isccc Rework isccc_ccmsg to support multiple messages per tcp read 2024-04-18 20:08:44 +02:00
isccfg Add checkconf check for signatures-jitter 2024-04-18 09:50:33 +02:00
ns Keep track of the recursive clients highwater 2024-05-10 12:08:52 +03:00
.gitignore The isc/platform.h header has been completely removed 2021-07-06 05:33:48 +00:00
Makefile.am Move irs_resconf into libdns and remove libirs 2023-02-24 09:38:59 +00:00