MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / constructor

Method constructor

lib/cache/in-memory.ts:36–43  ·  view source on GitHub ↗
(cacheName: string, cacheMb: number)

Source from the content-addressed store, hash-verified

34 private readonly cache: LRUCache<string, Buffer>;
35
36 constructor(cacheName: string, cacheMb: number) {
37 super(cacheName, `InMemoryCache(${cacheMb}Mb)`, 'memory');
38 this.cacheMb = cacheMb;
39 this.cache = new LRUCache({
40 maxSize: cacheMb * 1024 * 1024,
41 sizeCalculation: n => n.length,
42 });
43 }
44
45 override statString(): string {
46 return `${super.statString()}, LRU has ${this.cache.size} item(s) totalling ${this.cache.calculatedSize} bytes`;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected