rocksdb/port/win
Levi Tamasi 30fb9dd50f Introduce a helper method UncompressData (#7434)
Summary:
The patch introduces a helper method in `util/compression.h` called `UncompressData`
that dispatches calls to the correct uncompression method based on type, and changes
`UncompressBlockContentsForCompressionType` and `Benchmark::Uncompress` in
`db_bench` so they are implemented in terms of the new method. This eliminates
some code duplication. (`Benchmark::Compress` is also updated to use the previously
introduced `CompressData` helper.)

In addition, the patch brings the implementation of `Snappy_Uncompress` into sync with
the other uncompression methods by making the method compute the buffer size and allocate
the buffer itself. Finally, the patch eliminates some potentially risky back-and-forth conversions
between various unsigned and signed integer types by exposing the size of the allocated buffer
as a `size_t` instead of an `int`.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/7434

Test Plan:
`make check`
`./db_bench -benchmarks=compress,uncompress --compression_type ...`

Reviewed By: riversand963

Differential Revision: D23900011

Pulled By: ltamasi

fbshipit-source-id: b25df63ceec4639889be94acb22eb53e530c54e0
2020-09-25 09:01:45 -07:00
..
env_default.cc build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
env_win.cc build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
env_win.h build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
io_win.cc build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
io_win.h build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
port_win.cc build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
port_win.h Posix threads (#6865) 2020-06-03 12:01:57 -07:00
win_jemalloc.cc build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
win_logger.cc build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
win_logger.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
win_thread.cc build: make it compile with @mode/win (#7406) 2020-09-23 12:55:54 -07:00
win_thread.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
xpress_win.cc Introduce a helper method UncompressData (#7434) 2020-09-25 09:01:45 -07:00
xpress_win.h Introduce a helper method UncompressData (#7434) 2020-09-25 09:01:45 -07:00