librsync  2.3.4
Data Fields
weaksum Struct Reference

Abstract wrapper around weaksum implementations. More...

#include <checksum.h>

Collaboration diagram for weaksum:
[legend]

Data Fields

weaksum_kind_t kind
 
union {
   Rollsum   rs
 
   rabinkarp_t   rk
 
sum
 

Detailed Description

Abstract wrapper around weaksum implementations.

This is a polymorphic interface to the different rollsum implementations.

Historically rollsum methods were implemented as static inline functions because they were small and needed to be fast. Now that we need to call different methods for different rollsum implementations, they are getting more complicated. Is it better to delegate calls to the right implementation using static inline switch statements, or stop inlining them and use virtual method pointers? Tests suggest inlined switch statements is faster.

Definition at line 56 of file checksum.h.

Field Documentation

◆ kind

weaksum_kind_t weaksum::kind

Definition at line 57 of file checksum.h.

◆ rs

Rollsum weaksum::rs

Definition at line 59 of file checksum.h.

◆ rk

rabinkarp_t weaksum::rk

Definition at line 60 of file checksum.h.


The documentation for this struct was generated from the following file: