On 23 Sep 2016, at 11:29, Gerriet M. Denkmann via swift-users <swift-users@swift.org> wrote:
> What about calloc then? Or use allocate and do a memset afterwards? For trivial data types (like UInt8) this will work, but if you want to follow the rules I recommend reading the following: * UnsafeRawPointer Migration <https://swift.org/migration-guide/se-0107-migrate.html> * SE-0107 “UnsafeRawPointer API” <https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md> Spoiler: that’ll point you to `initialize(to:count:)` (-: * * * Also, why are you manually allocating this rather than using [UInt8]? The latter is easier, safer, and likely to have similar levels of efficiency. Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware _______________________________________________ swift-users mailing list swift-users@swift.org https://lists.swift.org/mailman/listinfo/swift-users