MCPcopy Create free account
hub / github.com/Marus/cortex-debug / addToCache

Method addToCache

src/backend/disasm.ts:577–590  ·  view source on GitHub ↗
(arg: InstructionRange)

Source from the content-addressed store, hash-verified

575 }
576
577 private addToCache(arg: InstructionRange) {
578 for (let ix = 0; ix < this.cache.length;) {
579 const old = this.cache[ix++];
580 if (old.tryMerge(arg)) {
581 // See if we can merge with next neighbor
582 if ((ix < this.cache.length) && old.tryMerge(this.cache[ix])) {
583 this.cache.splice(ix, 1);
584 }
585 return;
586 }
587 }
588 this.cache.push(arg);
589 this.cache.sort((a, b) => a.startAddress - b.startAddress);
590 }
591
592 //
593 // This is not normal disassembly. We have to conform to what VSCode expects even beyond

Callers 1

doWorkMethod · 0.95

Calls 1

tryMergeMethod · 0.80

Tested by

no test coverage detected