|
I believe that following the suggestion of the compiler (note) would lead to a performance regression. Please have a look at the definition of page_id_t. Ever since MDEV-17491, the size of the object is 64 bits, which ought to be the same as the size of a pointer or a reference. Even on a 32-bit system, https://github.com/isocpp/CppCoreGuidelines/issues/1514 intentionally leaves this open in the C++ Core Guidelines: the size of the object would be exactly twice the size of a pointer or a reference.
Would the warning go away if you simply removed the const? We do want to copy the 64-bit quantity there. (Also note that before 10.5, page_id_t wrapped two 32-bit members; in 10.5 it is wrapping one 64-bit member.)
|