[swift-users] Functions getting compiled multiple times

2017-11-05 Thread Dan Stenmark via swift-users
I’ve recently been profiling our compile times using the -debug-time-function-bodies flag, and I’ve noticed that some functions seem to be listed multiple times. I know that -debug-time-function-bodies isn’t something that’s officially supported, but I’m not sure how to distinguish between a b

Re: [swift-users] Stored Property on Protocol Extension

2016-09-12 Thread Dan Stenmark via swift-users
There's no good way of using extensions to expand the storage of an external module's type unless you're using Associated Objects underneath, but that has heavy performance implications (especially in threaded cases, which would require global locks on the associated object store). At most, I'd

Re: [swift-users] UnsafeMutablePointer in structs

2016-05-20 Thread Dan Stenmark via swift-users
No, you’ll have to wrap it in a class. That said, class references from a struct are frowned upon, as you may wind up sharing mutable state (which structs are meant to combat). What’re you trying to represent with the UnsafeMutablePointer? A connection handle? Dan > On May 20, 2016, at 12:5

Re: [swift-users] Swift concurrency story on Linux?

2015-12-23 Thread Dan Stenmark via swift-users
What’s the target timeline looking like for a complete GCD implementation? The GitHub page explicitly states that we’re aiming for Foundation to have a complete implementation by Swift 3, but there’s no milestone information for GCD. (I’m hacking away at NSTask right now, and I keep getting re

Re: [swift-users] Instantiate Swift class from string

2015-12-10 Thread Dan Stenmark via swift-users
NSSelectorFromString() is still available in Swift, and you should be able to use the result of that in performSelector, though I’m hesitant to support this approach as it flies in the face of the safety Swift tries to enforce. I’m curious about your use case here; are you trying to create some