Improve the unsafe stack allocation