cpp/memory/align

Given a pointer to a buffer of size, returns a pointer aligned by the specified  for  number of bytes and decreases  argument by the number of bytes used for alignment. The first aligned address is returned.

The function modifies the pointer only if it would be possible to fit the wanted number of bytes aligned by the given alignment into the buffer. If the buffer is too small, the function does nothing and returns.

The behavior is undefined if is not a power of two.

Return value
The adjusted value of, or null pointer value if the space provided is too small.