Bug - When creating an empty disk in the UI, the emulator seems to silently fail when the disk size is above 2046 MB
- Dominant language
- JavaScript
- Stars
- 23.5k
- Forks
- 1.9k
- Avg merge
- 2d 14h
- Merged PRs (30d)
- 7
Description
Hi,
I found out earlier through some testing that attempting to use the custom setup UI on copy.sh/v86 that when the size of the disk is set to 2047 MB or higher, the emulator will silently fail to start.
Checking ide.js I found:
`const buffer = new Uint8Array(byte_count);`
I think, but I can't be certain that because this is a Uint8Array that this is because the limit is reached for the size of the array because it can't be as large as 2047 * 1024 * 1024 items long, although 2046 * 1024 * 1024 works just fine.
Some fixes for this I think might work would be to split it into an JSON object or array and have each block stored in it as a 2046 MB each, so we can have disk sizes of nearly any amount.
I would be happy to contribute this in a PR if you would like, though I might not be able to work on one for about 1–2 weeks. I’ll probably only be able to make major contributions after, where I will have more time, but I’d still love to help out when I can.
My environment:
Chrome v133
v86 version: 0eec2965
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.