Commit 2a6fa1c4 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-21132: Use memcpy_aligned, memset_aligned

parent 4b087e17
...@@ -60,11 +60,8 @@ buf_flush_note_modification( ...@@ -60,11 +60,8 @@ buf_flush_note_modification(
ut_ad(mach_read_from_8(block->frame + FIL_PAGE_LSN) <= end_lsn); ut_ad(mach_read_from_8(block->frame + FIL_PAGE_LSN) <= end_lsn);
mach_write_to_8(block->frame + FIL_PAGE_LSN, end_lsn); mach_write_to_8(block->frame + FIL_PAGE_LSN, end_lsn);
if (UNIV_LIKELY_NULL(block->page.zip.data)) { if (UNIV_LIKELY_NULL(block->page.zip.data)) {
compile_time_assert(FIL_PAGE_LSN % 8 == 0); memcpy_aligned<8>(FIL_PAGE_LSN + block->page.zip.data,
*reinterpret_cast<uint64_t*>(FIL_PAGE_LSN FIL_PAGE_LSN + block->frame, 8);
+ block->page.zip.data)
= *reinterpret_cast<const uint64_t*>(FIL_PAGE_LSN
+ block->frame);
} }
if (block->page.oldest_modification == 0) { if (block->page.oldest_modification == 0) {
......
...@@ -2122,8 +2122,7 @@ dberr_t PageConverter::operator()(buf_block_t* block) UNIV_NOTHROW ...@@ -2122,8 +2122,7 @@ dberr_t PageConverter::operator()(buf_block_t* block) UNIV_NOTHROW
const bool full_crc32 = fil_space_t::full_crc32(get_space_flags()); const bool full_crc32 = fil_space_t::full_crc32(get_space_flags());
byte* frame = get_frame(block); byte* frame = get_frame(block);
compile_time_assert(FIL_PAGE_LSN % 8 == 0); memset_aligned<8>(frame + FIL_PAGE_LSN, 0, 8);
*reinterpret_cast<uint64_t*>(frame + FIL_PAGE_LSN)= 0;
if (!block->page.zip.data) { if (!block->page.zip.data) {
buf_flush_init_for_writing( buf_flush_init_for_writing(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment