Files
swift-mirror/stdlib/stdlib.docc/manual-memory-management.md
Chris Adamson d0d078517a Update stdlib DocC curation for 6.4 symbols. (#92405)
This PR updates files in the `stdlib.docc` directory to provide curation
for symbols added to the standard library in release 6.4, including task
cancellation shields and refs.

The [stdlib documentation on
docs.swift.org](https://docs.swift.org/latest/documentation/swift) uses
these files to organize the online documentation into topics.

This PR doesn't affect any compilable source. It's only for the use of
the `docc` compiler to produce documentation, either in swift.org's CI
or if someone wants to generate a local copy.

rdar://181594680
2026-10-01 14:21:26 -07:00

1.8 KiB

Manual Memory Management

Allocate and manage memory manually.

Topics

First Steps

Safe Memory Access

  • Swift/Span
  • Swift/RawSpan
  • Swift/OutputSpan
  • Swift/OutputRawSpan
  • Swift/UTF8Span
  • Swift/MutableSpan
  • Swift/MutableRawSpan
  • Swift/SpanIterator

Safe Access to Raw Bytes

  • Swift/FullyInhabited
  • Swift/ConvertibleFromBytes
  • Swift/ConvertibleToBytes
  • Swift/ByteOrder
  • Swift/bitCast(_:to:)

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:_:)-3ywhh
  • Swift/withUnsafeMutableBytes(of:_:)
  • Swift/withTemporaryAllocation(byteCount:alignment:_:)
  • Swift/withTemporaryAllocation(of:capacity:_:)
  • Swift/withUnsafeTemporaryAllocation(of:capacity:_:)
  • Swift/withUnsafeTemporaryAllocation(byteCount:alignment:_:)
  • Swift/swap(_:_:)
  • Swift/exchange(_:with:)

Memory Layout

  • Swift/MemoryLayout

Heap Storage

  • Swift/UniqueArray
  • Swift/UniqueBox

Reference Counting

  • Swift/Unmanaged
  • Swift/withExtendedLifetime(_:_:)-4mmpv
  • Swift/withExtendedLifetime(_:_:)-59dz3
  • Swift/extendLifetime(_:)