diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-08 15:55:09 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-04-08 21:33:49 +0300 |
commit | e7f426d2c9be3ebc7c373e80873996ce8857ab48 (patch) | |
tree | 9a7503bd3687941c64207e95ffccf872dd31afe9 /storage/innobase/fsp | |
parent | f120a15b93dcb88adc31ad4fc7caf63b813ca63e (diff) | |
download | mariadb-git-e7f426d2c9be3ebc7c373e80873996ce8857ab48.tar.gz |
MDEV-19212: Replace macros with type-safe inline functions
The regression that was reported in MDEV-19212 occurred due to use
of macros that did not ensure that the arguments have compatible
types.
ut_2pow_remainder(), ut_2pow_round(), ut_calc_align(): Define as
inline function templates.
UT_CALC_ALIGN(): Define as a macro, because this is used in
compile_time_assert(). Only starting with C++11 (MariaDB 10.4)
we could define the inline functions as constexpr.
Diffstat (limited to 'storage/innobase/fsp')
-rw-r--r-- | storage/innobase/fsp/fsp0fsp.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/innobase/fsp/fsp0fsp.cc b/storage/innobase/fsp/fsp0fsp.cc index 7ef7788e4ec..ac48747513b 100644 --- a/storage/innobase/fsp/fsp0fsp.cc +++ b/storage/innobase/fsp/fsp0fsp.cc @@ -955,7 +955,7 @@ fsp_try_extend_data_file(fil_space_t* space, fsp_header_t* header, mtr_t* mtr) /* We ignore any fragments of a full megabyte when storing the size to the space header */ - space->size_in_header = ut_calc_align_down( + space->size_in_header = ut_2pow_round( space->size, (1024 * 1024) / page_size.physical()); mlog_write_ulint( |