geraldholdsworth / DiscImageManager

To manage retro floppy disc images
https://www.geraldholdsworth.co.uk
GNU General Public License v3.0
80 stars 8 forks source link

Stream the disc image instead of loading the entire file #8

Open geraldholdsworth opened 3 years ago

geraldholdsworth commented 3 years ago

Currently Disc Image Manager loads the entire disc image into memory then works on it from there. This is fine for speed, and for floppy images and most RISC OS and AmigaDOS hard disc images. But for bigger images - RISC OS 4.39 could access a 40GB drive, while the latest, 5.28, can access much bigger drives, particularly on a Raspberry Pi. This leaves this application open for a crash should it be presented with a file much bigger than memory allows.

The other advantage to streaming the disc image is that the application can access what it needs, much like a floppy or hard drive head in a physical machine.

stuaxo commented 11 months ago

Memory mapping the image file is an option that might be worth considering too.