-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avoid to wrongly allocate memory in map_file() #531
Conversation
BTW, I guess that we don't have coverage for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Benchmarks
Benchmark suite | Current: f554a00 | Previous: cb5eb10 | Ratio |
---|---|---|---|
Dhrystone |
1287 Average DMIPS over 10 runs |
1328 Average DMIPS over 10 runs |
1.03 |
Coremark |
962.761 Average iterations/sec over 10 runs |
964.938 Average iterations/sec over 10 runs |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please refine the commit message that might contain "avoid reallocating memory" (or something like that) to indicate your change.
The condition |
@RinHizakura Thanks for the fix. It indeed an implementation bug. |
Sorry for the unclear question, I was asking about the CI/CD coverage in fact. |
You can simply skip the condition |
Breakage reported by CI:
|
In the case that HAVE_MMAP=0, we allocates extra resources on the emulated memory. This is not correct and will abort the system emulation. Fix the issue to make system emulation works correctly.
This is not related to this change. The same warning can be found in other CI/CD jobs https://github.com/sysprog21/rv32emu/actions/runs/12540405349/job/34967656388 even if it passes. Not sure if any issues on the CI/CD justify this as a fail. |
Thank @RinHizakura for contributing! |
In the case that
HAVE_MMAP
is 0, the emulator crashes.The
map_file()
logic whenHAVE_MMAP == 0
is weird as it allocates extra resources on the emulated memory. After this change, the aborting issue is gone, so I believe the original is not the correct implementation.