From e33de8133eef9480863668fec2d1742f5d5aa871 Mon Sep 17 00:00:00 2001 From: alesapin Date: Tue, 15 Jan 2019 23:50:57 +0300 Subject: [PATCH] Unaligned store of the first element --- dbms/src/Compression/CompressionCodecDelta.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dbms/src/Compression/CompressionCodecDelta.cpp b/dbms/src/Compression/CompressionCodecDelta.cpp index 93bc5140805..089a16d1dd9 100644 --- a/dbms/src/Compression/CompressionCodecDelta.cpp +++ b/dbms/src/Compression/CompressionCodecDelta.cpp @@ -47,7 +47,7 @@ void compressDataForType(const char * source, UInt32 source_size, char * dest) auto * dest_with_type = reinterpret_cast(dest); if (source_size > 0) - dest_with_type[0] = source_with_type[0]; + unalignedStore(&dest_with_type[0], source_with_type[0]); for (size_t dest_index = 1, dest_end = source_size / sizeof(T); dest_index < dest_end; ++dest_index) unalignedStore(&dest_with_type[dest_index], source_with_type[dest_index] - source_with_type[dest_index - 1]); @@ -63,7 +63,7 @@ void decompressDataForType(const char * source, UInt32 source_size, char * dest) auto * dest_with_type = reinterpret_cast(dest); if (source_size > 0) - dest_with_type[0] = source_with_type[0]; + unalignedStore(&dest_with_type[0], source_with_type[0]); for (size_t dest_index = 1, dest_end = source_size / sizeof(T); dest_index < dest_end; ++dest_index) unalignedStore(&dest_with_type[dest_index], source_with_type[dest_index] + dest_with_type[dest_index - 1]);