Release pooled cache reference in complete/unwind (#22464)

This commit is contained in:
Joseph Savona 2021-09-29 15:49:52 -07:00 committed by GitHub
parent 95ecd4a2c3
commit 201af81b01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 8 deletions

View File

@ -99,14 +99,16 @@ export function popRootCachePool(root: FiberRoot, renderLanes: Lanes) {
return;
}
// The `pooledCache` variable points to the cache that was used for new
// cache boundaries during this render, if any. Stash it on the root so that
// parallel transitions may share the same cache. We will clear this field
// once all the transitions that depend on it (which we track with
// `pooledCacheLanes`) have committed.
// cache boundaries during this render, if any. Move ownership of the
// cache to the root so that parallel transitions may share the same
// cache. We will clear this field once all the transitions that depend
// on it (which we track with `pooledCacheLanes`) have committed.
root.pooledCache = pooledCache;
if (pooledCache !== null) {
root.pooledCacheLanes |= renderLanes;
}
// set to null, conceptually we are moving ownership to the root
pooledCache = null;
}
export function restoreSpawnedCachePool(

View File

@ -99,14 +99,16 @@ export function popRootCachePool(root: FiberRoot, renderLanes: Lanes) {
return;
}
// The `pooledCache` variable points to the cache that was used for new
// cache boundaries during this render, if any. Stash it on the root so that
// parallel transitions may share the same cache. We will clear this field
// once all the transitions that depend on it (which we track with
// `pooledCacheLanes`) have committed.
// cache boundaries during this render, if any. Move ownership of the
// cache to the root so that parallel transitions may share the same
// cache. We will clear this field once all the transitions that depend
// on it (which we track with `pooledCacheLanes`) have committed.
root.pooledCache = pooledCache;
if (pooledCache !== null) {
root.pooledCacheLanes |= renderLanes;
}
// set to null, conceptually we are moving ownership to the root
pooledCache = null;
}
export function restoreSpawnedCachePool(