mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
In their previous form, the non-`_f` variants of these entry points were unused, and IRGen lowered the `createAsyncTask` builtins to use the `_f` variants with a large amount of caller-side codegen to manually unpack closure values. Amid all this, it also failed to make anyone responsible for releasing the closure context after the task completed, causing every task creation to leak. Redo the `swift_task_create_*` entry points to accept the two words of an async closure value directly, and unpack the closure to get its invocation entry point and initial context size inside the runtime. (Also get rid of the non-future `swift_task_create` variant, since it's unused and it's subtly different in a lot of hairy ways from the future forms. Better to add it later when it's needed than to have a broken unexercised version now.)
4.6 KiB
4.6 KiB