memory
Swift 6.2 InlineArray and Span types for zero-overhead memory access, fixed-size collections, and safe pointer alternatives. Use when optimizing performance-critical code paths.
npx skills add rshankras/claude-code-apple-skills --skill memory --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# InlineArray and Span Guidance for Swift 6.2's low-level memory types: `InlineArray` for fixed-size inline storage without heap allocation, and `Span` for safe, zero-cost access to contiguous memory. These replace common uses of `UnsafeBufferPointer` and hand-tuned tuple storage with compiler-checked alternatives. ## When This Skill Activates Use this skill when the user: - Asks about **InlineArray**, **fixed-size arrays**, or **stack-allocated collections** - Mentions **Span**, **MutableSpan**, **RawSpan**, or **UTF8Span** - Wants to **eliminate heap allocations** in hot paths - Is replacing **UnsafeBufferPointer** or **UnsafePointer** with safe alternatives - Asks about **value generics** or `let count: Int` generic parameters - Needs **zero-copy** access to collection storage - Mentions **inline storage**, **contiguous memory**, or **memory layout** - Is doing **binary parsing**, **signal processing**, or **embedded Swift** work - Wants to avoid **copy-on-write overhead** for small fixed collections - Asks about **non-escapable types** or **lifetime dependencies** in Swift ## Decision Tree ``` What memory optimization do you need? │ ├─ A fixed-size collection that never grows/s
- When This Skill Activates
- Decision Tree
- API Availability
- Top 5 Mistakes
- InlineArray
- Declaration
- Initialization
- Memory Layout
- Basic Usage
- InlineArray vs Array
- Span Family
- Span (Read-Only)
- MutableSpan
- RawSpan
What does the memory skill do?
Swift 6.2 InlineArray and Span types for zero-overhead memory access, fixed-size collections, and safe pointer alternatives. Use when optimizing performance-critical code paths.
How do I install it?
Run `npx skills add rshankras/claude-code-apple-skills --skill memory --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From rshankras/claude-code-apple-skills, a repository with 589 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
