LCOV - code coverage report
Current view: top level - util/racesan - fd_racesan_base.h (source / functions) Hit Total Coverage
Test: cov.lcov Lines: 0 8 0.0 %
Date: 2026-07-12 05:24:35 Functions: 0 171 0.0 %

          Line data    Source code
       1             : #ifndef HEADER_fd_src_util_racesan_fd_racesan_base_h
       2             : #define HEADER_fd_src_util_racesan_fd_racesan_base_h
       3             : 
       4             : #include "../../util/fd_util_base.h"
       5             : 
       6             : #ifndef FD_HAS_RACESAN
       7             : #define FD_HAS_RACESAN 0
       8             : #endif
       9             : 
      10             : struct fd_racesan;
      11             : typedef struct fd_racesan fd_racesan_t;
      12             : 
      13             : FD_PROTOTYPES_BEGIN
      14             : 
      15             : /* fd_racesan_strhash is a FNV-1a for 64-bit implementation of string
      16             :    hashing.  Used to hash racesan hook names to integers.  The compiler
      17             :    can typically evaluate the following at compile time:
      18             : 
      19             :      ulong x = fd_racesan_strhash( "hello", sizeof("hello")-1 );
      20             :      ... x is resolved at compile time ... */
      21             : 
      22             : static inline ulong
      23             : fd_racesan_strhash( char const * s,
      24           0 :                     ulong        len ) {
      25           0 :   ulong x = 0xCBF29CE484222325UL;
      26           0 :   for( ; len; len--, s++ ) {
      27           0 :     x ^= (ulong)(uchar)( *s );
      28           0 :     x *= 0x100000001B3UL;
      29           0 :   }
      30           0 :   return x;
      31           0 : }
      32             : 
      33             : FD_PROTOTYPES_END
      34             : 
      35             : #endif /* HEADER_fd_src_util_racesan_fd_racesan_base_h */

Generated by: LCOV version 1.14