MortySmith to Swift · 5 months agoAre dictionaries on the stack or on the heap?message-squaremessage-square2fedilinkarrow-up17arrow-down10
arrow-up17arrow-down1message-squareAre dictionaries on the stack or on the heap?MortySmith to Swift · 5 months agomessage-square2fedilink
minus-squareroanutil_linkfedilinkarrow-up2·5 months agoI can’t look at the source right now, but it’s likely heap. Swift stdlib collections typically use a buffer that is a reference type. The whole ‘copy on write’ thing requires reference types somewhere in the guts (if I remember correctly).
I can’t look at the source right now, but it’s likely heap. Swift stdlib collections typically use a buffer that is a reference type. The whole ‘copy on write’ thing requires reference types somewhere in the guts (if I remember correctly).