/swift-optimal-memory-layout

Declare your Swift variables using a Macro for optimal Memory Layout.

Primary LanguageSwiftApache License 2.0Apache-2.0

Sorts stored property declarations in the optimal layout so they don't waste memory.

Requires at least Swift 5.9 Apache 2.0 License

Limitations

Current limitations of Swift Macros doesn't enable this library to support custom objects, only values found in the Standard Library (and Foundation).

However, it does support custom objects but you have to supply the literal memory layout (no reference or stored value) using the correct macro.

This library organizes custom objects at the bottom, just above objects that have a 1,1,1 (alignment,size,stride) memory layout.