> On Jul 14, 2017, at 11:27 AM, Michael Ilseman <milse...@apple.com> wrote:
> 
>> I also have to say it’s not common to deallocate something in Swift that you 
>> didn’t previously allocate in Swift. 
>> 
> 
> I’m not sure it is even defined to use `deallocate` on memory that wasn’t 
> `allocated` in Swift. Andy, thoughts here? Perhaps more clarity in 
> deallocate’s documentation is needed?

If my memory is correct, Swift’s `deallocate` requires a pointer that was 
allocated via Swift’s `allocate`.

What’s missing from the docs I suppose is the fact that we now have a set of 
Swift allocate/deallocate entry points, which are of course compatible as long 
as the user keeps track of the capacity and alignment. IMO the buffer pointer 
API should alleviate that responsibility from the user.

-Andy
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to