3 ms·
But Swift has no way of signaling to C that the memory can be freed so I’m pretty sure it does a copy when using String’s cString constructor.
by maria2 4y ago
But Swift has no way of signaling to C that the memory can be freed so I’m pretty sure it does a copy when using String’s cString constructor.
- saagarjha 4y agoWhen you pass a Swift String to C you do so with a given lifetime. By default this is the duration of the call.