[swift-evolution] [Review] SE-0107: UnsafeRawPointer API

Magnus Ahltorp map at kth.se
Tue Jul 5 10:09:56 CDT 2016


> The review of “SE-0107: UnsafeRawPointer API” begins now and runs through July 4, 2016. The proposal is available here:
> 
> 	https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md

I have not had time for a full review, but I have a question about the proposal:

When glancing at the examples, they strike me as mostly being marshalling, which in my opinion would be better served by a safe marshalling API followed by unsafe handling of the resulting buffer, and vice versa for unmarshalling. I think it is very important (in the long run) that code that doesn't interact with C directly has safe ways of doing inherently safe operations, and not take the unsafe route just because that is the only API available.

My question is, how does this API fit into the bigger picture of marshalling, and what are the benefits of using this API instead of marshalling with safe buffers?

I would consider "we don't have time, we have to do this for now" a perfectly valid answer.

/Magnus



More information about the swift-evolution mailing list