News for hackers. Stuff that matters.
Re:Fast memcpy, A System Design by maria2 on Monday December 19, 2022 @08:48PM (#34060508)
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.
Re:Fast memcpy, A System Design by saagarjha on Tuesday December 20, 2022 @06:03PM (#34074086)
When you pass a Swift String to C you do so with a given lifetime. By default this is the duration of the call.