librsync  2.3.2
Data Fields
weaksum Struct Reference

Abstract wrapper around weaksum implementations. More...

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 51 of file checksum.h.


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