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.
- Host: GitHub
- URL: https://github.com/randomhashtags/swift-optimal-memory-layout
- Owner: RandomHashTags
- License: apache-2.0
- Created: 2025-01-19T02:47:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-03T16:14:27.000Z (12 months ago)
- Last Synced: 2025-03-19T11:45:02.812Z (10 months ago)
- Topics: memory-management, optimization, swift, swift-macro
- Language: Swift
- Homepage:
- Size: 25.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Sorts stored property declarations in the optimal layout so they don't waste memory.
## 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.