swift
cec4442b - IRGen: Don't release a stack-allocated closure context in its forwarder.

Commit
13 days ago
IRGen: Don't release a stack-allocated closure context in its forwarder. When the partial application forwarder of an at-most-once closure didn't consume any of the context's fields, it released the context object, even when the context was allocated on the caller's stack. Releasing a stack object only calls its destructor, so this needlessly called into the runtime, which also made calling such a closure in Embedded Swift depend on `swift_release`. Call the destructor of a stack-allocated context directly and leave its deallocation to the caller's `dealloc_stack`. Resolves rdar://190773932.
Author
Committer
Parents
Loading