2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

6 Commits

Author SHA1 Message Date
Ondřej Surý
f5c204ac3e
Move the library init and shutdown to executables
Instead of relying on unreliable order of execution of the library
constructors and destructors, move them to individual binaries.  The
advantage is that the execution time and order will remain constant and
will not depend on the dynamic load dependency solver.

This requires more work, but that was mitigated by a simple requirement,
any executable using libisc and libdns, must include <isc/lib.h> and
<dns/lib.h> respectively (in this particular order).  In turn, these two
headers must not be included from within any library as they contain
inlined functions marked with constructor/destructor attributes.
2025-02-22 16:19:00 +01:00
Michal Nowak
dd234c60fe
Update the source code formatting using clang-format-17 2023-10-17 17:47:46 +02:00
Ondřej Surý
a5f5f68502
Refactor isc_time_now() to return time, and not result
The isc_time_now() and isc_time_now_hires() were used inconsistently
through the code - either with status check, or without status check,
or via TIME_NOW() macro with RUNTIME_CHECK() on failure.

Refactor the isc_time_now() and isc_time_now_hires() to always fail when
getting current time has failed, and return the isc_time_t value as
return value instead of passing the pointer to result in the argument.
2023-03-31 15:02:06 +02:00
Tony Finch
cf715d488b Suppress division by zero warning
Coverity is optimistic that we might do thousands of hashes in less
than a microsecond.

    /tests/bench/siphash.c: 54 in main()
    48     			count++;
    49     		}
    50
    51     		isc_time_now_hires(&finish);
    52
    53     		us = isc_time_microdiff(&finish, &start);
    >>>     CID 358309:  Integer handling issues  (DIVIDE_BY_ZERO)
    >>>     In expression "count * 1000UL / us", division by expression "us" which may be zero has undefined behavior.
    54     		printf("%f us wide-lower len %3zu, %7llu kh/s (%llx)\n",
    55     		       (double)us / 1000000.0, len,
    56     		       (unsigned long long)(count * 1000 / us),
    57     		       (unsigned long long)sum);
    58     	}
    59
2022-10-05 12:31:42 +01:00
Ondřej Surý
c14a4ac763
Add a case-insensitive option directly to siphash 2-4 implementation
Formerly, the isc_hash32() would have to change the key in a local copy
to make it case insensitive.  Change the isc_siphash24() and
isc_halfsiphash24() functions to lowercase the input directly when
reading it from the memory and converting the uint8_t * array to
64-bit (respectively 32-bit numbers).
2022-10-04 10:32:40 +02:00
Tony Finch
de10d697ab
A simple siphash benchmark
To see the effect of adding a case-insentitive option.
2022-10-04 10:32:40 +02:00