We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
md5: 15808bd575cde83e771a99499ba11747
Issue Description:
Code to reproduce:
let fm = NSFileManager.defaultManager() for _ in 0..<1_000_000 { let path = "/Users/Hemet/Library" let fsr = fm.fileSystemRepresentationWithPath(path) }
Debugger reports 140 MB allocated.
public func fileSystemRepresentationWithPath(path: String) -> UnsafePointer<Int8> { precondition(path != "", "Empty path argument") let len = CFStringGetMaximumSizeOfFileSystemRepresentation(path._cfObject) if len == kCFNotFound { return nil } // memory allocated here let buf = UnsafeMutablePointer<Int8>.alloc(len) for i in 0..<len { buf.advancedBy(i).initialize(0) } if !path._nsObject.getFileSystemRepresentation(buf, maxLength: len) { buf.destroy(len) buf.dealloc(len) return nil } // never freed, leak here return UnsafePointer(buf) }
The text was updated successfully, but these errors were encountered:
Comment by Eugene Gubin (JIRA)
It is known issue https://github.com/apple/swift-corelibs-foundation/blob/master/Docs/Issues.md (see last paragraph)
Sorry, something went wrong.
No branches or pull requests
Additional Detail from JIRA
md5: 15808bd575cde83e771a99499ba11747
Issue Description:
Code to reproduce:
Debugger reports 140 MB allocated.
The text was updated successfully, but these errors were encountered: