diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/digest/crc32c/crc32c.cpp | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/digest/crc32c/crc32c.cpp')
-rw-r--r-- | library/cpp/digest/crc32c/crc32c.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/library/cpp/digest/crc32c/crc32c.cpp b/library/cpp/digest/crc32c/crc32c.cpp index 369b46a213..63daa12859 100644 --- a/library/cpp/digest/crc32c/crc32c.cpp +++ b/library/cpp/digest/crc32c/crc32c.cpp @@ -1,40 +1,40 @@ #include "crc32c.h" - + #include <util/generic/singleton.h> #include <contrib/libs/crcutil/interface.h> -namespace { - typedef crcutil_interface::CRC TCrc; - - struct TCrcUtilSse4 { - TCrc* const Pimpl; +namespace { + typedef crcutil_interface::CRC TCrc; + + struct TCrcUtilSse4 { + TCrc* const Pimpl; TCrcUtilSse4() noexcept - : Pimpl(TCrc::Create(0x82f63b78, 0, 32, true, 0, 0, 0, TCrc::IsSSE42Available(), nullptr)) - { - } + : Pimpl(TCrc::Create(0x82f63b78, 0, 32, true, 0, 0, 0, TCrc::IsSSE42Available(), nullptr)) + { + } - ~TCrcUtilSse4() noexcept { - Pimpl->Delete(); - } + ~TCrcUtilSse4() noexcept { + Pimpl->Delete(); + } inline ui32 Extend(ui32 init, const void* data, size_t n) const noexcept { - crcutil_interface::UINT64 sum = init; - Pimpl->Compute(data, n, &sum); - return (ui32)sum; - } + crcutil_interface::UINT64 sum = init; + Pimpl->Compute(data, n, &sum); + return (ui32)sum; + } }; -} - -ui32 Crc32c(const void* p, size_t size) noexcept { - return Singleton<TCrcUtilSse4>()->Extend(0, p, size); -} - -ui32 Crc32cExtend(ui32 init, const void* data, size_t n) noexcept { - return Singleton<TCrcUtilSse4>()->Extend(init, data, n); -} +} -bool HaveFastCrc32c() noexcept { - return TCrc::IsSSE42Available(); +ui32 Crc32c(const void* p, size_t size) noexcept { + return Singleton<TCrcUtilSse4>()->Extend(0, p, size); } + +ui32 Crc32cExtend(ui32 init, const void* data, size_t n) noexcept { + return Singleton<TCrcUtilSse4>()->Extend(init, data, n); +} + +bool HaveFastCrc32c() noexcept { + return TCrc::IsSSE42Available(); +} |