[swift-corelibs-dev] NSMutableData memory leak

Ian Partridge ipartridge at gmail.com
Mon May 16 11:45:47 CDT 2016


On 16 May 2016 at 17:43, Philippe Hausler <phausler at apple.com> 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 managed by the deallocator blocks. So I bet the problem is that the code-path for NSMutableData(capacity: 0) is hitting the don’t deallocate code path incorrectly (where as the other versions are hitting the appropriate flagging; hence the crashes)
>
> Does this also occur in the Darwin builds of this? (Using SwiftFoundtion instead of Foundation)

Yes, I have been investigating this using a new TestNSData test under XCode.

-- 
Ian Partridge


More information about the swift-corelibs-dev mailing list