An open API service indexing awesome lists of open source software.

https://github.com/randomhashtags/swift-optimal-memory-layout

Declare your Swift variables using a Macro for optimal Memory Layout.
https://github.com/randomhashtags/swift-optimal-memory-layout

memory-management optimization swift swift-macro

Last synced: 10 months ago
JSON representation

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

Awesome Lists containing this project

README

          

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.