What is the difference between value types and reference types in Swift, and how do they impact memory allocation?