Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Greg Parker via swift-users
> On Nov 2, 2016, at 1:08 PM, Joe Groff via swift-users > wrote: > >> On Nov 2, 2016, at 1:00 PM, Philippe Hausler > > wrote: >> >> See: >> >> https://github.com/apple/swift-corelibs-foundation/blob/d015466450b2675037c6f1ace8e17e73050ccfb9/Foundation/NSURL.swift#L56

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Bernardo Breder via swift-users
2016-11-02 18:36 GMT-02:00 Joe Groff : > > On Nov 2, 2016, at 1:16 PM, Bernardo Breder via swift-users < > swift-users@swift.org> wrote: > > In my http server i want to manager the memory all the time that we close > a socket, like the example of manager in this link: > http://stackoverflow.com/qu

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jens Alfke via swift-users
> On Nov 2, 2016, at 1:42 PM, Bernardo Breder via swift-users > wrote: > > The algorithm that i send is a example of server code and this code will > execute in a ubuntu environment. When i install in the ubuntu, the swiftc > show me that the autoreleasepool is "use of unresolved identifier

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jordan Rose via swift-users
> On Nov 2, 2016, at 13:36, Joe Groff via swift-users > wrote: > >> >> On Nov 2, 2016, at 1:16 PM, Bernardo Breder via swift-users >> mailto:swift-users@swift.org>> wrote: >> >> In my http server i want to manager the memory all the time that we close a >> socket, like the example of manage

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Joe Groff via swift-users
> On Nov 2, 2016, at 1:16 PM, Bernardo Breder via swift-users > wrote: > > In my http server i want to manager the memory all the time that we close a > socket, like the example of manager in this link: > http://stackoverflow.com/questions/25860942/is-it-necessary-to-use-autoreleasepool-in-a-

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Bernardo Breder via swift-users
In my http server i want to manager the memory all the time that we close a socket, like the example of manager in this link: http://stackoverflow.com/questions/25860942/is-it-necessary-to-use-autoreleasepool-in-a-swift-program Algorithm that show the ideia: *func request(content) { ... }* *let

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Joe Groff via swift-users
> On Nov 2, 2016, at 1:00 PM, Philippe Hausler wrote: > > See: > > https://github.com/apple/swift-corelibs-foundation/blob/d015466450b2675037c6f1ace8e17e73050ccfb9/Foundation/NSURL.swift#L561 > >

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jordan Rose via swift-users
I don’t know, this isn’t really a good Swift API either. Some of the other bare pointer cases we changed to return arrays instead for this reason, like String’s version of cString(using:). https://github.com/apple/swift/blob/master/stdlib/public/SDK/Foundation/NSStringAPI.swift#L413 I am actual

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Philippe Hausler via swift-users
See: https://github.com/apple/swift-corelibs-foundation/blob/d015466450b2675037c6f1ace8e17e73050ccfb9/Foundation/NSURL.swift#L561 This is far and few between of cases t

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jordan Rose via swift-users
I’m confused about this. Shouldn’t you be able to get away with using +1 convention everywhere? What needs to have arbitrary lifetime-extension in an ARC-ified language? Jordan > On Nov 2, 2016, at 12:23, Philippe Hausler wrote: > > So there are issues we have in swift-corelibs that suffer(le

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Philippe Hausler via swift-users
So trivially we could do something along these lines to “solve it” in swift-corelibs-foundation instead of polluting the swift standard library with objective-c-isms on Linux. internal class NSAutoreleasePool { fileprivate static var _current = NSThreadSpecific() internal static var cur

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Philippe Hausler via swift-users
So there are issues we have in swift-corelibs that suffer(leak) because we don't have ARPs on Linux. It would be super nice to have a retain until scope end concept for swift core libs where autorelease would be an accessor in unmanaged that would retain the object until the arp ends scope. Sen

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jens Alfke via swift-users
> On Nov 2, 2016, at 09:42, Joe Groff via swift-users > wrote: > > Autoreleasepools are an ObjC compatibility feature. They aren't necessary in > standalone Swift. So Swift’s ref-counting doesn’t use any autorelease mechanism? I was assuming it did (even if it’s not identical to Obj-C’s.) I

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Bernardo Breder via swift-users
I want to manager the memory, using the autoreleasepool block, with ubuntu environment, as we can do with Xcode. 2016-11-02 15:34 GMT-02:00 Joe Groff : > > On Nov 2, 2016, at 10:17 AM, Jordan Rose wrote: > > > On Nov 2, 2016, at 09:42, Joe Groff via swift-users > wrote: > > > On Nov 1, 2016, at

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Joe Groff via swift-users
> On Nov 2, 2016, at 10:17 AM, Jordan Rose wrote: > >> >> On Nov 2, 2016, at 09:42, Joe Groff via swift-users > > wrote: >> >>> >>> On Nov 1, 2016, at 6:40 PM, Bernardo Breder via swift-users >>> mailto:swift-users@swift.org>> wrote: >>> >>> Hello, >>> >>> I w

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Jordan Rose via swift-users
> On Nov 2, 2016, at 09:42, Joe Groff via swift-users > wrote: > >> >> On Nov 1, 2016, at 6:40 PM, Bernardo Breder via swift-users >> wrote: >> >> Hello, >> >> I want to create a mini http server project and execute at Ubuntu 15. The >> Xcode compile and access the function "autoreleasepo

Re: [swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Joe Groff via swift-users
> On Nov 1, 2016, at 6:40 PM, Bernardo Breder via swift-users > wrote: > > Hello, > > I want to create a mini http server project and execute at Ubuntu 15. The > Xcode compile and access the function "autoreleasepool", but when i compile > the same code at Ubuntu, this function not found >

[swift-users] Autoreleasepool for Ubuntu

2016-11-02 Thread Bernardo Breder via swift-users
Hello, I want to create a mini http server project and execute at Ubuntu 15. The Xcode compile and access the function "autoreleasepool", but when i compile the same code at Ubuntu, this function not found For example, i can compile the code above at Xcode: while true { autoreleasepool {