> This might be silly, but what if there were a struct with all of the relevant 
> fields (not sure what the best name would be):
> 
> struct MemoryLayout {
>  let size: Int
>  let alignment: Int
>  let stride: Int
> // etc
> }
> 
> Then you’d only maybe need two functions:
> 
> memoryLayout(of:) and memoryLayout(ofType:)

Could the `memoryLayout` functions just return `(size: Int, alignment: Int, 
spacing: Int)` tuples? It's hard to tell because it goes into Builtin land, but 
I get the impression that these values are calculated at compile time anyway, 
and if you only used one of them the optimizer could throw the others away.

-- 
Brent Royal-Gordon
Architechies

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to