Revert "Switch to heap allocator"

This reverts commit efebf357be8e5578bcf7fd492cd83c5cf6a8db57.