Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-12739] Document Swift Memory Model and UnsafePointer #55184

atrick opened this issue May 6, 2020 · 1 comment

[SR-12739] Document Swift Memory Model and UnsafePointer #55184

atrick opened this issue May 6, 2020 · 1 comment


Copy link

atrick commented May 6, 2020

Previous ID SR-12739
Radar rdar://18542360
Original Reporter @atrick
Type Task
Additional Detail from JIRA
Votes 2
Component/s Standard Library
Labels Task
Assignee @atrick
Priority Medium

md5: 375ebdd2ecb596d6714efdeae73106a8

Issue 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](

[Memory Model Introduced by SE-0107](

[Unsafe[Mutable]RawPointer API](

[UnsafeRawPointer Migration Guide](

[SE-0138]( and the [doc comments](

[UnsafeRawPointer doc comments](

[Andy's unofficial working document on type safety](

Copy link

amomchilov commented Aug 28, 2021

For future archaeologists, here's a WWDC 2020 video that went into this stuff in detail: Safely manage pointers in Swift

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants