mkclass: Optimize struct layout

fixes #7615