]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Call adler32_c directly in adler32_copy_c scalar fallback
authorNathan Moinvaziri <nathan@nathanm.com>
Tue, 17 Mar 2026 02:03:25 +0000 (19:03 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Fri, 1 May 2026 12:34:00 +0000 (14:34 +0200)
The generic copy function was calling through the function
table, which dispatched to the best SIMD implementation
instead of the scalar path. This led to incorrect benchmarks
for adler32_copy/c since it measured the SIMD path rather
than the scalar fallback. Call adler32_c directly so the
scalar copy variant actually exercises the scalar checksum.

arch/generic/adler32_c.c

index 755d60a62b851c9328737147c37268bd932f3e47..5161406bce41ca7d3a4d680931f68caca58966a2 100644 (file)
@@ -54,7 +54,7 @@ Z_INTERNAL uint32_t adler32_c(uint32_t adler, const uint8_t *buf, size_t len) {
 }
 
 Z_INTERNAL uint32_t adler32_copy_c(uint32_t adler, uint8_t *dst, const uint8_t *src, size_t len) {
-    adler = FUNCTABLE_CALL(adler32)(adler, src, len);
+    adler = adler32_c(adler, src, len);
     memcpy(dst, src, len);
     return adler;
 }