Skip to content

Commit

Permalink
Limit cache size by default to 256 entries
Browse files Browse the repository at this point in the history
Fixes #65.
  • Loading branch information
kelunik committed Dec 16, 2017
1 parent 417a4a8 commit 16e6d6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"php": ">=7.0",
"amphp/amp": "^2",
"amphp/byte-stream": "^1.1",
"amphp/cache": "^1",
"amphp/cache": "^1.2",
"amphp/file": "^0.2 || ^0.3",
"amphp/parser": "^1",
"amphp/uri": "^0.1",
Expand Down
2 changes: 1 addition & 1 deletion lib/BasicResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ final class BasicResolver implements Resolver {
private $gcWatcher;

public function __construct(Cache $cache = null, ConfigLoader $configLoader = null) {
$this->cache = $cache ?? new ArrayCache;
$this->cache = $cache ?? new ArrayCache(5000 /* default gc interval */, 256 /* size */);
$this->configLoader = $configLoader ?? (\stripos(PHP_OS, "win") === 0
? new WindowsConfigLoader
: new UnixConfigLoader);
Expand Down

0 comments on commit 16e6d6c

Please sign in to comment.