diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-11-29 11:23:35 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-11-29 11:23:35 +0200 |
commit | 51a4260f0047d00ced28256192e142b1570ffe05 (patch) | |
tree | b3bb4d8899bc3925978baa00a8be719ac3cecf55 /include/m_string.h | |
parent | 0f71e9e66ba1a0dde5acdb5c7e2578d8d2b212cc (diff) | |
download | mariadb-git-51a4260f0047d00ced28256192e142b1570ffe05.tar.gz |
MDEV-21133: Introduce memmove_aligned()
Both variants of the InnoDB page directory are aligned to the entry size
(16 bits). Inform the compiler about it.
Diffstat (limited to 'include/m_string.h')
-rw-r--r-- | include/m_string.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/m_string.h b/include/m_string.h index cc7ff48e390..068460f878c 100644 --- a/include/m_string.h +++ b/include/m_string.h @@ -210,6 +210,13 @@ inline void *memcpy_aligned(void *dest, const void *src, size_t n) MY_ASSUME_ALIGNED(src, Alignment), n); } template <size_t Alignment> +inline void *memmove_aligned(void *dest, const void *src, size_t n) +{ + static_assert(Alignment && !(Alignment & (Alignment - 1)), "power of 2"); + return memmove(MY_ASSUME_ALIGNED(dest, Alignment), + MY_ASSUME_ALIGNED(src, Alignment), n); +} +template <size_t Alignment> inline int memcmp_aligned(const void *s1, const void *s2, size_t n) { static_assert(Alignment && !(Alignment & (Alignment - 1)), "power of 2"); |