finds.dev← search

// the find

CoderMJLee/Mems

★ 333 · Swift · MIT · updated Nov 2019

Utils for viewing memory in Swift.

Mems is a tiny Swift debugging utility for inspecting raw memory layout of values and objects — addresses, byte content, sizes. It's squarely aimed at developers learning Swift internals or debugging ARC/layout issues, not production use.

The byte-alignment option on memStr is a nice touch — being able to view memory grouped by 1/2/4/8 bytes matters when you're tracing struct padding. The examples in the README are genuinely useful: showing enum discriminant placement and the three String storage strategies (tagged pointer, TEXT segment, heap) teaches you something real about how Swift works under the hood. The API surface is tiny and does exactly what it says.

Abandoned since November 2019 — Swift internals have changed enough since then that some of the memory layouts shown may no longer be accurate on current runtimes. There are no tests, so you have no way to know when a Swift update silently breaks the assumptions. It's also just a playground-style Xcode project, not a Swift Package — you can't add it as a dependency with SPM, which is the only reasonable way to pull in a utility like this today.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →