monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-devel] Patch review on sha1.cc


From: Jack Lloyd
Subject: [Monotone-devel] Patch review on sha1.cc
Date: Tue, 22 Dec 2009 15:48:56 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

Wanted to ping the list before I checked this in.

sha1.cc uses botan's provided benchmark functions in versions that
support them (>=1.7.22). However in 1.7.22 only, it was necessary to
check against macros to figure out what kind of Timer class to pass to
the function. I felt this was obnoxious and added a typedef
(Default_Benchmark_Timer) in benchmark.h in 1.7.23, which was released
about a week later, and which more or less mirrors what sha1.cc is
doing.

(Also, sha1.cc won't actually compile on !Unix/!Win32 systems with
botan 1.7.23 or later, because at that point Timer becamse an abstract
class and ANSI_Clock_Timer took over. Also Win32's Timer
implementation uses QueryPerformanceCounter which has an unknown rate,
so while sha1.cc does compile on Win32, the results will probably be
very bogus (though I haven't confirmed this)).

This simply changes sha1.cc to rely on 1.7.23 features; for 1.7.22
sha1.cc backs down to the previous hash-a-100 Mb std::string method
already used with 1.6 and earlier 1.7.

Also, because I was in there, added support for 1.9.4 (not yet
released) which removes the Timer class entirely and does all
decisions on what timing source to use internally.

-Jack

Attachment: sha1.cc.patch
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]