next.js
931eee87 - refactor(turbo-tasks): Use an execution id instead of the parent task id to prevent local Vc escapes (#78487)

Commit
262 days ago
refactor(turbo-tasks): Use an execution id instead of the parent task id to prevent local Vc escapes (#78487) Re-using the task id just for the `Vc` scope escape check isn't ideal: - A task can execute multiple times. Just using task ids doesn't guarantee that the `Vc` hasn't leaked across multiple executions of the same task. - This is just a fallback check to help with debugging, so allocating 32 bits to this id seems wasteful. We can do a good job with 16 bits. Nothing else really needs the task id, so we can get rid of it later in this PR stack. A version of this idea was part of the original local tasks idea: https://www.notion.so/vercel/Resolved-Vcs-Vc-Lifetimes-Local-Vcs-and-Vc-Refcounts-49d666d3f9594017b5b312b87ddc5bff?pvs=4#da95dbdc390144a9bb1b3d2fb73867b7 Even with this extra 4 bits, the overall enum size is still 16 bits due to alignment and the size of the other enum variants, so this shouldn't regress memory consumption. The next PR (https://github.com/vercel/next.js/pull/78561) removes `TaskId` entirely...
Author
bgw bgw
Parents
Loading