[master 15/19] Factor out aligning of size to resize unit into a separate method.