itoshkov / nand2tetris-emu

Nand2Tetris Software Suite - hardware simulator and CPU and VM emulators
http://www.nand2tetris.org
GNU General Public License v2.0
90 stars 29 forks source link

Fix regression in OS VM files #18

Closed axelkern closed 8 months ago

axelkern commented 8 months ago

The 2.5.7 source code archive contained outdated VM files of Memory.vm and Sys.vm. The official software suite 2.6 zip archive already contained an updated version of the OS VM files. The source code archive on the nand2tetris website was however never updated accordingly.

The OS update addressed the following issues:

  1. Sys.error included a call to String.new which could cause itself a runtime error via Memory.alloc, resulting in recursive calls to Sys.error and ultimately crashing with a stack overflow.
  2. Memory.vm contains now a better allocation algorithm with defragmentation of adjacent blocks