MortySmith to Swift · 9 months agoAre dictionaries on the stack or on the heap?message-squaremessage-square2linkfedilinkarrow-up17arrow-down10
arrow-up17arrow-down1message-squareAre dictionaries on the stack or on the heap?MortySmith to Swift · 9 months agomessage-square2linkfedilink
minus-squareroanutil_linkfedilinkarrow-up2·9 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).