The purpose of this bug is to gather feedback and suggestions for information that should be included in the documentation and how it should be presented.
Several related areas of the Swift memory model need documentation beyond the evolution proposals and API docs:
Type safety, type conversions, and rebinding memory types
Expected usage of Unsafe[Mutable]Raw[Buffer]Pointer
Expected usage of "memory binding" APIs
C interoperability
I'm not sure how much, if any, of this documentation should be part of a formal evolution process. But, let's first focus on writing it down somewhere. Currently, we many forum posts, and only sparse formal documentation:
Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 2 | |Component/s | Standard Library | |Labels | Task | |Assignee | @atrick | |Priority | Medium | md5: 375ebdd2ecb596d6714efdeae73106a8Issue Description:
The purpose of this bug is to gather feedback and suggestions for information that should be included in the documentation and how it should be presented.
Several related areas of the Swift memory model need documentation beyond the evolution proposals and API docs:
Basic semantics: allocation, alignment, (de)initialization, type-bound memory
Typed vs untyped (raw) pointers
Type safety, type conversions, and rebinding memory types
Expected usage of Unsafe[Mutable]Raw[Buffer]Pointer
Expected usage of "memory binding" APIs
C interoperability
I'm not sure how much, if any, of this documentation should be part of a formal evolution process. But, let's first focus on writing it down somewhere. Currently, we many forum posts, and only sparse formal documentation:
[UnsafeRawPointer SE-0107](https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md).
[Memory Model Introduced by SE-0107](https://github.com/apple/swift-evolution/blob/master/proposals/0107-unsaferawpointer.md#memory-model-explanation)
[Unsafe[Mutable]RawPointer API](https://github.com/apple/swift/blob/master/stdlib/public/core/UnsafeRawPointer.swift)
[UnsafeRawPointer Migration Guide](https://swift.org/migration-guide-swift3/se-0107-migrate.html)
[SE-0138](https://github.com/apple/swift-evolution/blob/master/proposals/0138-unsaferawbufferpointer.md) and the [doc comments](https://github.com/apple/swift/blob/master/stdlib/public/core/UnsafeRawBufferPointer.swift.gyb)
[UnsafeRawPointer doc comments](https://github.com/apple/swift/blob/master/stdlib/public/core/UnsafeRawPointer.swift)
[Andy's unofficial working document on type safety](https://github.com/atrick/swift/blob/type-safe-mem-docs/docs/TypeSafeMemory.rst)