How to handle UnsafeMutablePointer correctly
问题 I am a little confused. When do I have to call free and when destroy/dealloc? I am working on a short code snippet learning core audio. I thought if I call UnsafeMutablePointer<Type>.alloc(size) then I should call destroy & dealloc . But if I use malloc() or calloc() I am supposed to call free() . In this example from Learning Core Audio the following code snippet makes me wonder: var asbds = UnsafeMutablePointer<AudioStreamBasicDescription>.alloc(Int(infoSize)) audioErr =