From 1ee060ca0dfae7d0a1c830c7495f3125acf0ec7f Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 15 Aug 2020 05:25:28 -0400 Subject: common/compression: Roll back std::span changes Seems like all compilers don't support std::span yet. --- src/common/lz4_compression.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'src/common/lz4_compression.h') diff --git a/src/common/lz4_compression.h b/src/common/lz4_compression.h index 088ff5c91..87a4be1b0 100644 --- a/src/common/lz4_compression.h +++ b/src/common/lz4_compression.h @@ -4,7 +4,6 @@ #pragma once -#include #include #include "common/common_types.h" @@ -14,11 +13,12 @@ namespace Common::Compression { /** * Compresses a source memory region with LZ4 and returns the compressed data in a vector. * - * @param source the uncompressed source memory region. + * @param source The uncompressed source memory region. + * @param source_size The size of the uncompressed source memory region. * * @return the compressed data. */ -[[nodiscard]] std::vector CompressDataLZ4(std::span source); +[[nodiscard]] std::vector CompressDataLZ4(const u8* source, std::size_t source_size); /** * Utilizes the LZ4 subalgorithm LZ4HC with the specified compression level. Higher compression @@ -26,21 +26,24 @@ namespace Common::Compression { * compression level has almost no impact on decompression speed. Data compressed with LZ4HC can * also be decompressed with the default LZ4 decompression. * - * @param source the uncompressed source memory region. - * @param compression_level the used compression level. Should be between 3 and 12. + * @param source The uncompressed source memory region. + * @param source_size The size of the uncompressed source memory region. + * @param compression_level The used compression level. Should be between 3 and 12. * * @return the compressed data. */ -[[nodiscard]] std::vector CompressDataLZ4HC(std::span source, s32 compression_level); +[[nodiscard]] std::vector CompressDataLZ4HC(const u8* source, std::size_t source_size, + s32 compression_level); /** * Utilizes the LZ4 subalgorithm LZ4HC with the highest possible compression level. * - * @param source the uncompressed source memory region. + * @param source The uncompressed source memory region. + * @param source_size The size of the uncompressed source memory region * * @return the compressed data. */ -[[nodiscard]] std::vector CompressDataLZ4HCMax(std::span source); +[[nodiscard]] std::vector CompressDataLZ4HCMax(const u8* source, std::size_t source_size); /** * Decompresses a source memory region with LZ4 and returns the uncompressed data in a vector. -- cgit v1.2.3