#165 calculate stack size based on sizeof