diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2021-12-04 12:55:26 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2021-12-04 12:55:26 +0200 |
commit | 6deaff58a9d5208f3c2a3e57fd17ecac17fe34ad (patch) | |
tree | 1fca64379e88e9ee12cf215ead4318981eab3434 | |
parent | 3f7040fa979ff37ff339188c97c7eabe21f6e5fa (diff) | |
download | mariadb-git-6deaff58a9d5208f3c2a3e57fd17ecac17fe34ad.tar.gz |
MDEV-27058 fixup: GCC 11 -march=i686 -Warray-bounds
page_zip_des_t::clear(): Avoid a bogus GCC warning with
some pointer arithmetics. Yes, storing the unrelated member "fix"
in this object is ugly, but it avoids memory alignment overhead
on 64-bit architectures.
-rw-r--r-- | storage/innobase/include/page0types.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/storage/innobase/include/page0types.h b/storage/innobase/include/page0types.h index d18cea66b30..885d2290f7c 100644 --- a/storage/innobase/include/page0types.h +++ b/storage/innobase/include/page0types.h @@ -113,9 +113,10 @@ struct page_zip_des_t #endif /* UNIV_DEBUG */ void clear() { - memset((void*) this, 0, sizeof(data) + sizeof(uint32_t)); - ut_d(m_start = 0); - ut_d(m_external = false); + /* Clear everything except the member "fix". */ + memset((void*) this, 0, + reinterpret_cast<char*>(&fix) + - reinterpret_cast<char*>(this)); } private: |