Commit Graph

11 Commits

Author SHA1 Message Date
Robert Schulze
a7734672b9
Use std::popcount, ::countl_zero, ::countr_zero functions
- Introduced with the C++20 <bit> header

- The problem with __builtin_c(l|t)z() is that 0 as input has an
  undefined result (*) and the code did not always check. The std::
  versions do not have this issue.

- In some cases, we continue to use buildin_c(l|t)z(), (e.g. in
  src/Common/BitHelpers.h) because the std:: versions only accept
  unsigned inputs (and they also check that) and the casting would be
  ugly.

(*) https://gcc.gnu.org/onlinedocs/gcc/Other-Builtins.html
2022-07-31 15:16:51 +00:00
vdimir
02a0caf28b
Fix build isIPAddressContainedIn 2021-03-29 16:28:51 +03:00
vdimir
24aa25d7dc
Reuse some functions for IPAddressContainedIn 2021-03-29 12:04:05 +03:00
PHO
9ece398c35 Changed the return type of DB::getCIDRMaskIPv6()
It now returns std::array instead of uint8_t *. Also added DB::getCIDRMaskIPv4().
2021-03-26 12:11:34 +09:00
vdimir
9ce010e82c
Add comment for IPV6_MASKS_COUNT 2020-12-01 22:12:11 +03:00
vdimir
1aaff75d9a
Fix style in IPv6ToBinary.cpp 2020-12-01 20:38:49 +03:00
vdimir
cd8e7981e0
Speedup applyCIDRMask for IPv6 with compile-time generated mask array 2020-11-29 20:54:46 +03:00
vdimir
77ffd25cc0
Fixes for IP dictionary
More meaningful parse errors

Code style fixes, more comments

Fix bytes_allocated calculation
2020-11-21 17:56:58 +03:00
vdimir
dbec289c9a
[wip] rewrite ip_dict data struct, fix bugs, add tests 2020-11-12 00:58:30 +03:00
vdimir
a67f5b780f
Use sorted ip array instead of trie in TrieDictionary 2020-11-08 19:19:04 +03:00
Ivan Lezhankin
06446b4f08 dbms/ → src/ 2020-04-03 18:14:31 +03:00