Make sizeof() expectation platform-independent and use alignof().

Change-Id: Iec532c84493ba63867fe7ac188de6035440b9c6d