D-Programming-Language/phobos — pull request #1654 by monarchdodra (2013-10-20 12:51:00+00:00)
Title: Reduce Scoped size

Two simple enough tweaks that reduces Scoped's size by 8 to 16 bytes (on 64 bit systems). The total "overhead" is now exactly +8 bytes compared to the class instance's size (used to be about 16-24).

First, we store the offset in a `ubyte`, as opposed to a `size_t`. This is combined with the fact that we only need `alignment - 1` padding (We never use the very last byte) means we can place the `offset` ubyte inside the very last byte of `alignement`.

An entire size_t saved!

Second, I removed the `aligned` in the calculation of the Scoped buffer. This is not necessary, and serves no purpose other than giving Scoped an "aligned size".