| for (let i=0; i < this.__switches.length; i++){ | for (let i=0; i < this.__switches.length; i++){ | ||||
| let pgs = this.__switches[i].mem.pages; | let pgs = this.__switches[i].mem.pages; | ||||
| if (paddr < pgs){ | if (paddr < pgs){ | ||||
| this.__switches[i].mem.clearPage(addr); | |||||
| this.__switches[i].mem.clearPage(paddr); | |||||
| break; | break; | ||||
| } | } | ||||
| paddr -= pgs; | paddr -= pgs; | ||||
| clear(){ | clear(){ | ||||
| this.__switches.forEach((s)=>{ | this.__switches.forEach((s)=>{ | ||||
| s.clear(); | |||||
| s.mem.clear(); | |||||
| }); | }); | ||||
| return this; | return this; | ||||
| } | } |