Re: [swift-users] UnsafeMutablePointer vs. UnsafeMutablePointer

2016-06-01 Thread Austin Zheng via swift-users
This shouldn't be something you need to worry about. The mechanism the OS uses to handle memory per process is different from the mechanism your process uses to allocate memory, and the OS should reclaim all the memory that your app used (whether it was 'leaked' or not). More info:

Re: [swift-users] UnsafeMutablePointer vs. UnsafeMutablePointer

2016-06-01 Thread Adrian Zubarev via swift-users
I’ve got one more question that bothers me. Lets say I’ve got a class that might look something like this: class Reference { var pointer: UnsafeMutablePointer init(integer: Int) { self.pointer = UnsafeMutablePointer.alloc(1) self.pointer.initialize(integer)

Re: [swift-users] UnsafeMutablePointer vs. UnsafeMutablePointer

2016-05-21 Thread Dmitri Gribenko via swift-users
On Sat, May 21, 2016 at 2:15 AM, Adrian Zubarev via swift-users wrote: > So basically if I do something like this I should be on the safe side: Yes, this code is safe. If you just want to store a contiguous buffer of elements of the same type, you should consider using

Re: [swift-users] UnsafeMutablePointer vs. UnsafeMutablePointer

2016-05-21 Thread Adrian Zubarev via swift-users
So basically if I do something like this I should be on the safe side: public class Characters { private let reference: UnsafeMutablePointer var characters: [Character] { var characters = [Character]() for index in