mirror of
https://github.com/apple/swift.git
synced 2026-10-28 21:15:56 +01:00
+3








9ead8781d4
Co-authored-by: Alex Martini <amartini@apple.com> Co-authored-by: Graham Lee <glee23@apple.com> Co-authored-by: Chris Adamson <cadamson@apple.com> Co-authored-by: Kirby Turner <kirby_turner@apple.com> Co-authored-by: Paris Pinkney <ppinkney@apple.com> Co-authored-by: Dave Spector <dspector@apple.com> Co-authored-by: Sofia Rodriguez Morales <sofia_rodriguez@apple.com> Co-authored-by: Ethan Kusters <ekusters@apple.com> Co-authored-by: Goli Mohammadi <g_mohammadi@apple.com> Co-authored-by: Adora Vaz <a_vaz@apple.com> Co-authored-by: David Rönnqvist <ronnqvist@apple.com> Co-authored-by: Nate Merseth Cook <natecook@apple.com> Co-authored-by: Susan Conant <susan_c@apple.com>
62 lines
1.4 KiB
Markdown
62 lines
1.4 KiB
Markdown
# Manual Memory Management
|
|
|
|
Allocate and manage memory manually.
|
|
|
|
## Topics
|
|
|
|
### First Steps
|
|
|
|
- <doc:calling-functions-with-pointer-parameters>
|
|
|
|
### Safe Memory Access
|
|
|
|
- ``Swift/Span``
|
|
- ``Swift/RawSpan``
|
|
- ``Swift/OutputSpan``
|
|
- ``Swift/UTF8Span``
|
|
- ``Swift/MutableSpan``
|
|
- ``Swift/MutableRawSpan``
|
|
- ``Swift/OutputRawSpan``
|
|
|
|
### Typed Pointers
|
|
|
|
Use typed pointers and buffers to access memory as instances of a specific type.
|
|
|
|
- ``Swift/UnsafePointer``
|
|
- ``Swift/UnsafeMutablePointer``
|
|
- ``Swift/UnsafeBufferPointer``
|
|
- ``Swift/UnsafeMutableBufferPointer``
|
|
|
|
### Raw Pointers
|
|
|
|
Use raw pointers and buffers to access memory for loading and storing as raw bytes.
|
|
|
|
- ``Swift/UnsafeRawPointer``
|
|
- ``Swift/UnsafeMutableRawPointer``
|
|
- ``Swift/UnsafeRawBufferPointer``
|
|
- ``Swift/UnsafeMutableRawBufferPointer``
|
|
|
|
### Memory Access
|
|
|
|
- ``Swift/withUnsafePointer(to:_:)-9fjn6``
|
|
- ``Swift/withUnsafePointer(to:_:)-35wrn``
|
|
- ``Swift/withUnsafeMutablePointer(to:_:)``
|
|
- ``Swift/withUnsafeBytes(of:_:)-5zxtl``
|
|
- ``Swift/withUnsafeBytes(of:_:)-5gesg``
|
|
- ``Swift/withUnsafeMutableBytes(of:_:)``
|
|
- ``Swift/withUnsafeTemporaryAllocation(of:capacity:_:)``
|
|
- ``Swift/withUnsafeTemporaryAllocation(byteCount:alignment:_:)``
|
|
- ``Swift/swap(_:_:)``
|
|
- ``Swift/exchange(_:with:)``
|
|
|
|
### Memory Layout
|
|
|
|
- ``Swift/MemoryLayout``
|
|
|
|
### Reference Counting
|
|
|
|
- ``Swift/Unmanaged``
|
|
- ``Swift/withExtendedLifetime(_:_:)-4mmpv``
|
|
- ``Swift/withExtendedLifetime(_:_:)-59dz3``
|
|
- ``Swift/extendLifetime(_:)``
|