MortySmith@programming.dev to Swift@programming.dev · 3 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@programming.dev to Swift@programming.dev · 3 months agomessage-square2fedilink
minus-squareroanutil_@programming.devlinkfedilinkarrow-up2·3 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).