[swift-users] How to malloc in Swift 3

Svein Halvor Halvorsen svein.h at lvor.halvorsen.cc
Fri Sep 23 05:08:59 CDT 2016


var bitfield: UnsafeMutablePointer<UInt8>?
bitfield = UnsafeMutablePointer<UInt8>.allocate(capacity: 888)


> 23. sep. 2016 kl. 10.47 skrev Gerriet M. Denkmann via swift-users <swift-users at swift.org>:
> 
> This used to work in Swift 2.2:
> 
> var bitfield: UnsafeMutablePointer<UInt8>?
> bitfield = UnsafeMutablePointer<UInt8>( malloc( 888 ) )
> 
> How is this written in Swift 3.0?
> 
> Gerriet.
> 
> _______________________________________________
> swift-users mailing list
> swift-users at swift.org
> https://lists.swift.org/mailman/listinfo/swift-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20160923/f7dcc1cd/attachment.html>


More information about the swift-users mailing list