diff options
| author | Kenneth Heafield <github@kheafield.com> | 2013-01-20 12:31:03 +0000 | 
|---|---|---|
| committer | Kenneth Heafield <github@kheafield.com> | 2013-01-20 12:31:03 +0000 | 
| commit | 2753c37d0b59df79be15d88222eb0f2ec6caf903 (patch) | |
| tree | 47a4f376b2b96dc6dfc9e526ea31a0970beea64c /klm/util/stream | |
| parent | 816632a5d1e3a5a24c9b3aacb4210ed8b28a9c62 (diff) | |
Better delimiters, cross-platform fixes
Diffstat (limited to 'klm/util/stream')
| -rw-r--r-- | klm/util/stream/sort.hh | 5 | ||||
| -rw-r--r-- | klm/util/stream/timer.hh | 8 | 
2 files changed, 8 insertions, 5 deletions
diff --git a/klm/util/stream/sort.hh b/klm/util/stream/sort.hh index df57fa41..a86f160f 100644 --- a/klm/util/stream/sort.hh +++ b/klm/util/stream/sort.hh @@ -259,8 +259,9 @@ template <class Compare, class Combine> class MergingReader {        while (in_offsets_->RemainingBlocks()) {          // Use bigger buffers if there's less remaining. -        uint64_t per_buffer = std::max(static_cast<uint64_t>(buffer_size_), -                                       static_cast<uint64_t>(total_memory_ / in_offsets_->RemainingBlocks())); +        uint64_t per_buffer = static_cast<uint64_t>(std::max<std::size_t>( +            buffer_size_, +            static_cast<std::size_t>((static_cast<uint64_t>(total_memory_) / in_offsets_->RemainingBlocks()))));          per_buffer -= per_buffer % entry_size;          assert(per_buffer); diff --git a/klm/util/stream/timer.hh b/klm/util/stream/timer.hh index 50e94fe8..7e1a5885 100644 --- a/klm/util/stream/timer.hh +++ b/klm/util/stream/timer.hh @@ -1,14 +1,16 @@  #ifndef UTIL_STREAM_TIMER__  #define UTIL_STREAM_TIMER__ -#include <boost/version.hpp> +// Sorry Jon, this was adding library dependencies in Moses and people complained. + +/*#include <boost/version.hpp>  #if BOOST_VERSION >= 104800  #include <boost/timer/timer.hpp>  #define UTIL_TIMER(str) boost::timer::auto_cpu_timer timer(std::cerr, 1, (str))  #else -//#warning Using Boost older than 1.48. Timing information will not be available. +//#warning Using Boost older than 1.48. Timing information will not be available.*/  #define UTIL_TIMER(str)  -#endif +//#endif  #endif // UTIL_STREAM_TIMER__  | 
