Skip to content

Commit b40efb3

Browse files
authored
Enables garbage collection on synchronous calls (#895)
1 parent 25f0e9b commit b40efb3

File tree

4 files changed

+49
-3
lines changed

4 files changed

+49
-3
lines changed

.pnp.js

+6-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.yarn/versions/546aff69.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
releases:
2+
"@yarnpkg/cli": prerelease
3+
"@yarnpkg/fslib": prerelease
4+
"@yarnpkg/pnp": prerelease
5+
6+
declined:
7+
- "@yarnpkg/plugin-constraints"
8+
- "@yarnpkg/plugin-dlx"
9+
- "@yarnpkg/plugin-essentials"
10+
- "@yarnpkg/plugin-exec"
11+
- "@yarnpkg/plugin-file"
12+
- "@yarnpkg/plugin-git"
13+
- "@yarnpkg/plugin-github"
14+
- "@yarnpkg/plugin-http"
15+
- "@yarnpkg/plugin-init"
16+
- "@yarnpkg/plugin-interactive-tools"
17+
- "@yarnpkg/plugin-link"
18+
- "@yarnpkg/plugin-node-modules"
19+
- "@yarnpkg/plugin-npm"
20+
- "@yarnpkg/plugin-npm-cli"
21+
- "@yarnpkg/plugin-pack"
22+
- "@yarnpkg/plugin-patch"
23+
- "@yarnpkg/plugin-pnp"
24+
- "@yarnpkg/plugin-stage"
25+
- "@yarnpkg/plugin-typescript"
26+
- "@yarnpkg/plugin-version"
27+
- "@yarnpkg/plugin-workspace-tools"
28+
- vscode-zipfs
29+
- "@yarnpkg/builder"
30+
- "@yarnpkg/core"
31+
- "@yarnpkg/doctor"
32+
- "@yarnpkg/json-proxy"
33+
- "@yarnpkg/pnpify"
34+
- "@yarnpkg/shell"

packages/yarnpkg-fslib/sources/ZipOpenFS.ts

+8-1
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,14 @@ export class ZipOpenFS extends BasePortableFakeFS {
792792
let zipFs = this.zipInstances.get(p);
793793

794794
if (!zipFs)
795-
this.zipInstances.set(p, zipFs = new ZipFS(p, getZipOptions()));
795+
zipFs = new ZipFS(p, getZipOptions());
796+
797+
// Removing then re-adding the field allows us to easily implement
798+
// a basic LRU garbage collection strategy
799+
this.zipInstances.delete(p);
800+
this.zipInstances.set(p, zipFs);
801+
802+
this.limitOpenFiles(this.maxOpenFiles);
796803

797804
return accept(zipFs);
798805
} else {

packages/yarnpkg-pnp/sources/hook.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)