librsync
2.3.4
|
Abstract wrapper around weaksum implementations. More...
#include <checksum.h>
Data Fields | |
weaksum_kind_t | kind |
union { | |
Rollsum rs | |
rabinkarp_t rk | |
} | sum |
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.
weaksum_kind_t weaksum::kind |
Definition at line 57 of file checksum.h.
Rollsum weaksum::rs |
Definition at line 59 of file checksum.h.
rabinkarp_t weaksum::rk |
Definition at line 60 of file checksum.h.