Measure Swift MemoryLayout: size, stride, and alignment
Measure reordered structs, optionals, and an existential. Distinguish a recorded layout from a permanent ABI guarantee or total heap usage.
Read articleCurated topic · 8 ARTICLES
Explore practical Swift articles grounded in clear explanations and engineering tradeoffs.
Latest articles
Measure reordered structs, optionals, and an existential. Distinguish a recorded layout from a permanent ABI guarantee or total heap usage.
Read articleCreate and break a strong cycle, observe weak references becoming nil, and distinguish an optional unowned reference from automatic zeroing.
Read articleBuild a small reference-backed buffer and verify one detachment on the first shared write, with no extra detachment on a later unique write.
Read articleCompare Character, Unicode scalar, UTF-16, and UTF-8 counts; verify equivalent Hangul keys and slice a family emoji without splitting it.
Read articleCompare two errors collapsed by try? with typed throws and stored Result values, then recover successful values or rethrow failures using get.
Read articleTest six inputs, preserve missing and invalid states, and verify when a nil-coalescing fallback runs instead of treating zero as absence.
Read articleCompare live variable capture, capture-list snapshots, and weak references, then store an escaping callback and execute it once after registration.
Read articleCompare a value, a class reference, and a struct containing a reference to see which mutations propagate and why struct does not imply a deep copy.
Read article