Re: [swift-corelibs-dev] NSMutableData memory leak

2016-05-16 Thread Ian Partridge via swift-corelibs-dev
On 16 May 2016 at 17:43, Philippe Hausler wrote: > I think there is probably some likely issue with the fact that NSMutableData > is a subclass and the layout initialization is not properly setup during the > init for that object. > > __kCFDontDeallocate is used to mark the allocated memory as m

Re: [swift-corelibs-dev] NSMutableData memory leak

2016-05-16 Thread Philippe Hausler via swift-corelibs-dev
I think there is probably some likely issue with the fact that NSMutableData is a subclass and the layout initialization is not properly setup during the init for that object. __kCFDontDeallocate is used to mark the allocated memory as managed by the deallocator blocks. So I bet the problem is

[swift-corelibs-dev] NSMutableData memory leak

2016-05-16 Thread Ian Partridge via swift-corelibs-dev
import Foundation while true { var myData: NSMutableData? = NSMutableData(capacity: 0) myData = nil } Running this infinite loop with swift-corelibs-foundation shows a steady memory leak, with the process's RSS increasing over time. No leak is seen with Foundation on Darwin. Instrumenting w