GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Release pooled cache reference in complete/unwind (#22464) · react/react@201af81

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • packages/react-reconciler/src
    • ReactFiberCacheComponent.new.js
    • ReactFiberCacheComponent.old.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎packages/react-reconciler/src/ReactFiberCacheComponent.new.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberCacheComponent.new.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ export function popRootCachePool(root: FiberRoot, renderLanes: Lanes) {
9999
return;
100100
}
101101
// The `pooledCache` variable points to the cache that was used for new
102-
// cache boundaries during this render, if any. Stash it on the root so that
103-
// parallel transitions may share the same cache. We will clear this field
104-
// once all the transitions that depend on it (which we track with
105-
// `pooledCacheLanes`) have committed.
102+
// cache boundaries during this render, if any. Move ownership of the
103+
// cache to the root so that parallel transitions may share the same
104+
// cache. We will clear this field once all the transitions that depend
105+
// on it (which we track with `pooledCacheLanes`) have committed.
106106
root.pooledCache = pooledCache;
107107
if (pooledCache !== null) {
108108
root.pooledCacheLanes |= renderLanes;
109109
}
110+
// set to null, conceptually we are moving ownership to the root
111+
pooledCache = null;
110112
}
111113

112114
export function restoreSpawnedCachePool(
Collapse file

‎packages/react-reconciler/src/ReactFiberCacheComponent.old.js‎

Copy file name to clipboardExpand all lines: packages/react-reconciler/src/ReactFiberCacheComponent.old.js
+6-4Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,16 @@ export function popRootCachePool(root: FiberRoot, renderLanes: Lanes) {
9999
return;
100100
}
101101
// The `pooledCache` variable points to the cache that was used for new
102-
// cache boundaries during this render, if any. Stash it on the root so that
103-
// parallel transitions may share the same cache. We will clear this field
104-
// once all the transitions that depend on it (which we track with
105-
// `pooledCacheLanes`) have committed.
102+
// cache boundaries during this render, if any. Move ownership of the
103+
// cache to the root so that parallel transitions may share the same
104+
// cache. We will clear this field once all the transitions that depend
105+
// on it (which we track with `pooledCacheLanes`) have committed.
106106
root.pooledCache = pooledCache;
107107
if (pooledCache !== null) {
108108
root.pooledCacheLanes |= renderLanes;
109109
}
110+
// set to null, conceptually we are moving ownership to the root
111+
pooledCache = null;
110112
}
111113

112114
export function restoreSpawnedCachePool(

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.