Loading [MathJax]/extensions/tex2jax.js
SyTen
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages

◆ next_multiple()

template<typename T , typename U >
constexpr T syten::EternalMalloc::next_multiple ( T const  current,
U const  alignment 
)
constexpr

Casts current to the type of alignment and adds the difference to the next value at which U(current) % alignment is zero; i.e. if alignment is 64, it returns the smallest value greater than current which is divisible by 64.