It's also not clear sometimes exactly what "out of bounds" means - for example,
you might have a big chunk of memory representing an array, and then you take a
pointer to only part of that memory, representing a slice of the array. In this
case you can write "out of bounds" of the slice, but the pointer type doesn't
know that (because you are still within the range of the chunk of memory that
you got from `UnsafeMutablePointer.memory()`).
True story. :D
Thank you for clarifying that to me, its a good example. Also the new pointer
that I’ll get here won’t be a slice of an array just because `Memory` isn’t a
slice. I’ll have to cast the pointer first, but I got the point here. ;)
One more thing:
- How does ARC work here when I create a new pointer to one of my allocated
objects?
- Do I have 2 strong references to my main piece of memory?
--
Adrian Zubarev
Sent with Airmail
Am 26. Mai 2016 bei 20:07:36, Austin Zheng (austinzh...@gmail.com) schrieb:
_______________________________________________
swift-users mailing list
swift-users@swift.org
https://lists.swift.org/mailman/listinfo/swift-users