@MortySmith to Swift • 2 months agoAre dictionaries on the stack or on the heap?message-square2arrow-up17arrow-down10
arrow-up17arrow-down1message-squareAre dictionaries on the stack or on the heap?@MortySmith to Swift • 2 months agomessage-square2
minus-square@roanutil_link2•2 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).