7
submitted 1 month ago by [email protected] to c/[email protected]
top 2 comments
sorted by: hot top controversial new old
[-] [email protected] 2 points 1 month ago

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).

[-] [email protected] 1 points 1 month ago

Dictionary is a value type so it is stack-allocated. But that value is a pretty thin wrapper around a heap-allocated backing store. I’m not sure how useful it is to think about or even know that detail. I hate doing the cliché thing here, but can I ask why you are asking?

this post was submitted on 27 Jul 2024
7 points (100.0% liked)

Swift

358 readers
1 users here now

This group focus on the content related to the development of Apple Eco-system software. So feel free to share and talk about, for example;

founded 1 year ago
MODERATORS