Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftmetatype and runtime metadataSingle-choice MCQ

Given an existential metatype like P.Type for a protocol P, why is its in-memory size 16 bytes while a concrete class metatype C.Type is only 8 bytes?

protocol P {} class C {} print(MemoryLayout<P.Type>.size) // 16 print(MemoryLayout<C.Type>.size) // 8