summaryrefslogtreecommitdiff
path: root/storage/innobase/buf/buf0buf.cc
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-12-05 06:42:31 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-12-05 06:42:31 +0200
commit42a4ae54c2f05bccd2d6d752bbc23652962b6929 (patch)
treeb483ef198239a4c41556a8181d27b9bb7d053b03 /storage/innobase/buf/buf0buf.cc
parent504202bd7fe7d7e85039fface189e721d1aeff7a (diff)
downloadmariadb-git-42a4ae54c2f05bccd2d6d752bbc23652962b6929.tar.gz
MDEV-21225 Remove ut_align() and use aligned_malloc()
Before commit 90c52e5291b3ad0935df7da56ec0fcbf530733b4 introduced aligned_malloc(), InnoDB always used a pattern of over-allocating memory and invoking ut_align() to guarantee the desired alignment. It is cleaner to invoke aligned_malloc() and aligned_free() directly. ut_align(): Remove. In assertions, ut_align_down() can be used instead.
Diffstat (limited to 'storage/innobase/buf/buf0buf.cc')
-rw-r--r--storage/innobase/buf/buf0buf.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc
index 6a2bc34c767..7f98be9e729 100644
--- a/storage/innobase/buf/buf0buf.cc
+++ b/storage/innobase/buf/buf0buf.cc
@@ -1601,8 +1601,11 @@ buf_chunk_init(
opt_large_page_size is smaller than srv_page_size,
we may allocate one fewer block than requested. When
it is bigger, we may allocate more blocks than requested. */
+ static_assert(sizeof(byte*) == sizeof(ulint), "pointer size");
- frame = (byte*) ut_align(chunk->mem, srv_page_size);
+ frame = reinterpret_cast<byte*>((reinterpret_cast<ulint>(chunk->mem)
+ + srv_page_size - 1)
+ & ~(srv_page_size - 1));
chunk->size = (chunk->mem_pfx.m_size >> srv_page_size_shift)
- (frame != chunk->mem);