We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b568f22 commit 202f2adCopy full SHA for 202f2ad
src/utils/file.c
@@ -2649,9 +2649,9 @@ find_zero_tail(char *buf, size_t len)
2649
return 0;
2650
2651
/* fast check for last bytes */
2652
- i = (len-1) & ~(PAGE_ZEROSEARCH_FINE_GRANULARITY-1);
2653
- l = len - i;
2654
- if (memcmp(buf + i, zerobuf, i) != 0)
+ l = Min(len, PAGE_ZEROSEARCH_FINE_GRANULARITY);
+ i = len - l;
+ if (memcmp(buf + i, zerobuf, l) != 0)
2655
return len;
2656
2657
/* coarse search for zero tail */
0 commit comments