https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118681

Harald van Dijk <harald at gigawatt dot nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |harald at gigawatt dot nl

--- Comment #8 from Harald van Dijk <harald at gigawatt dot nl> ---
(In reply to Jonathan Wakely from comment #7)
> This is a better fix, rounding up to the next multiple of the alignment:
> 
> const auto block_size = ((bytes + alignment - 1) / alignment) * alignment;

If alignment is known to be a power of two, this can be done as (bytes +
alignment - 1) & ~(alignment - 1).

Reply via email to