mirror of
https://github.com/zebrajr/react.git
synced 2025-12-06 12:20:20 +01:00
Release pooled cache reference in complete/unwind (#22464)
This commit is contained in:
parent
95ecd4a2c3
commit
201af81b01
|
|
@ -99,14 +99,16 @@ export function popRootCachePool(root: FiberRoot, renderLanes: Lanes) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// The `pooledCache` variable points to the cache that was used for new
|
// 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
|
// cache boundaries during this render, if any. Move ownership of the
|
||||||
// parallel transitions may share the same cache. We will clear this field
|
// cache to the root so that parallel transitions may share the same
|
||||||
// once all the transitions that depend on it (which we track with
|
// cache. We will clear this field once all the transitions that depend
|
||||||
// `pooledCacheLanes`) have committed.
|
// on it (which we track with `pooledCacheLanes`) have committed.
|
||||||
root.pooledCache = pooledCache;
|
root.pooledCache = pooledCache;
|
||||||
if (pooledCache !== null) {
|
if (pooledCache !== null) {
|
||||||
root.pooledCacheLanes |= renderLanes;
|
root.pooledCacheLanes |= renderLanes;
|
||||||
}
|
}
|
||||||
|
// set to null, conceptually we are moving ownership to the root
|
||||||
|
pooledCache = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function restoreSpawnedCachePool(
|
export function restoreSpawnedCachePool(
|
||||||
|
|
|
||||||
|
|
@ -99,14 +99,16 @@ export function popRootCachePool(root: FiberRoot, renderLanes: Lanes) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// The `pooledCache` variable points to the cache that was used for new
|
// 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
|
// cache boundaries during this render, if any. Move ownership of the
|
||||||
// parallel transitions may share the same cache. We will clear this field
|
// cache to the root so that parallel transitions may share the same
|
||||||
// once all the transitions that depend on it (which we track with
|
// cache. We will clear this field once all the transitions that depend
|
||||||
// `pooledCacheLanes`) have committed.
|
// on it (which we track with `pooledCacheLanes`) have committed.
|
||||||
root.pooledCache = pooledCache;
|
root.pooledCache = pooledCache;
|
||||||
if (pooledCache !== null) {
|
if (pooledCache !== null) {
|
||||||
root.pooledCacheLanes |= renderLanes;
|
root.pooledCacheLanes |= renderLanes;
|
||||||
}
|
}
|
||||||
|
// set to null, conceptually we are moving ownership to the root
|
||||||
|
pooledCache = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function restoreSpawnedCachePool(
|
export function restoreSpawnedCachePool(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user