How is Any implemented?

I had a response on another thread explaining the struct layout of it here: How does Swift know the address of an element in an array of Any? - #2 by Alejandro

If the value can be stored within 3 words, then it's stored inline the Any struct, otherwise Any stores a pointer to some heap object. The type information is simply a pointer to the metadata. If you have more questions, let me know!

3 Likes