> On Apr 3, 2017, at 4:33 PM, Jordan Rose <[email protected]> wrote: > >> On Mar 31, 2017, at 09:39, Joe Groff via swift-evolution >> <[email protected]> wrote: >> >> Protocol conformances are a distinct runtime object from the type itself. >> There's never any direct record of the conformance in a type's own metadata >> or instances. This is what allows conformances to be added externally by >> extensions from other modules. > > At the same time, you are not allowed to assume anything about the layout of > structs defined in Swift today. If the compiler wanted to insert the name of > the type between every member, it would be permitted to. Please do not assume > two structs that look "the same" are laid out the same; if you need to care > about in-memory layout, define the struct in C.
As I said in the original post: > I want to maintain the stride of an array being the total count times the > stride of the element, which would complicate nominal arrays if adding > protocols to one breaks that. This is for built-in arrays, which we don’t have yet. I want to make sure that enforcing “no padding outside the inner non-array type” won’t affect doing “cool Swift things” with the type. This question is mainly aimed towards Swift compiler implementors. — Daryle Walker Mac, Internet, and Video Game Junkie darylew AT mac DOT com
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
