[swift-dev] Questions about Struct's memory allocation

Sergo Bero sergo_bero at icloud.com
Tue Dec 20 11:14:51 CST 2016


Hello everyone,

I have a question about Swift Structs, regarding memory usage...
as WWDC talk ( Session 416 ) says, Swift uses heap memory to store large values ( contain more than 3 words as current inline buffer is 3 words ),
has something changed in this area since WWDC?
What are the advantages from copying it to heap?
is current behaviour final and will it be “baked” into Swift ABI?
is it possible to tell compiler ( or force ) to always use stack for value types ?


Regards,
Sergo






More information about the swift-dev mailing list