LCOV - differential code coverage report
Current view: top level - src/include/storage - checksum_block_internal.h Coverage Total Hit UBC CBC
Current: 77aeca80249c9e640c811e80633a2e334a9320de vs 38afc3dcb25c45b744d4025029ce0a6c90b7059f Lines: 100.0 % 11 11 11
Current Date: 2026-07-25 19:08:27 +0900 Functions: - 0 0
Baseline: lcov-20260725-baseline Branches: 66.7 % 30 20 10 20
Baseline Date: 2026-07-25 19:09:19 +0900 Line coverage date bins:
Legend: Lines:     hit not hit
Branches: + taken - not taken # not executed
(30,360] days: 100.0 % 11 11 11
Branch coverage date bins:
(30,360] days: 66.7 % 30 20 10 20

 Age         Owner                    Branch data    TLA  Line data    Source code
                                  1                 :                : /*-------------------------------------------------------------------------
                                  2                 :                :  *
                                  3                 :                :  * checksum_block_internal.h
                                  4                 :                :  *    Core algorithm for page checksums, semi-private to checksum_impl.h
                                  5                 :                :  *    and checksum.c.
                                  6                 :                :  *
                                  7                 :                :  * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
                                  8                 :                :  * Portions Copyright (c) 1994, Regents of the University of California
                                  9                 :                :  *
                                 10                 :                :  * src/include/storage/checksum_block_internal.h
                                 11                 :                :  *
                                 12                 :                :  *-------------------------------------------------------------------------
                                 13                 :                :  */
                                 14                 :                : 
                                 15                 :                : /* there is deliberately not an #ifndef CHECKSUM_BLOCK_INTERNAL_H here */
                                 16                 :                : 
                                 17                 :                : uint32      sums[N_SUMS];
  112 john.naylor@postgres       18                 :CBC     2643365 : uint32      result = 0;
                                 19                 :                : uint32      i,
                                 20                 :                :             j;
                                 21                 :                : 
                                 22                 :                : /* ensure that the size is compatible with the algorithm */
                                 23                 :                : Assert(sizeof(PGChecksummablePage) == BLCKSZ);
                                 24                 :                : 
                                 25                 :                : /* initialize partial checksums to their corresponding offsets */
                                 26                 :        2643365 : memcpy(sums, checksumBaseOffsets, sizeof(checksumBaseOffsets));
                                 27                 :                : 
                                 28                 :                : /* main checksum calculation */
                                 29   [ +  +  -  - ]:      171818725 : for (i = 0; i < (uint32) (BLCKSZ / (sizeof(uint32) * N_SUMS)); i++)
                                            [ +  + ]
                                 30   [ +  +  -  - ]:     5582786880 :     for (j = 0; j < N_SUMS; j++)
                                            [ +  + ]
                                 31                 :     5413611520 :         CHECKSUM_COMP(sums[j], page->data[i][j]);
                                 32                 :                : 
                                 33                 :                : /* finally add in two rounds of zeroes for additional mixing */
                                 34   [ +  +  -  - ]:        7930095 : for (i = 0; i < 2; i++)
                                            [ +  + ]
                                 35   [ +  +  -  - ]:      174462090 :     for (j = 0; j < N_SUMS; j++)
                                            [ +  + ]
                                 36                 :      169175360 :         CHECKSUM_COMP(sums[j], 0);
                                 37                 :                : 
                                 38                 :                : /* xor fold partial checksums together */
                                 39   [ +  +  -  - ]:       87231045 : for (i = 0; i < N_SUMS; i++)
                                            [ +  + ]
                                 40                 :       84587680 :     result ^= sums[i];
                                 41                 :                : 
                                 42                 :        2643365 : return result;
        

Generated by: LCOV version 2.0-1