Skip to content

Conversation

@kklobe
Copy link
Collaborator

@kklobe kklobe commented Jun 8, 2022

As I was looking through the paging and memory subsystems for troubleshooting the First Encounter crash on ARM systems, I noticed that while the paging.tlb arrays are statically allocated, the main MemBase memory block array isn't.

I made a simple change to make the arrays statically allocated. While I did not see a performance difference, I like the idea of automatic memory management and reducing the burden on the heap allocator.

This did not increase memory usage (under macOS), even though the full 64M MAX_MEMORY is reserved, because the unused range above memsize from dosbox.conf is never written.

@kklobe kklobe force-pushed the kk/memory-static-alloc branch 5 times, most recently from 9103878 to fa83113 Compare June 9, 2022 01:02
@kcgen kcgen self-requested a review June 9, 2022 02:23
@kcgen kcgen added cleanup Non-functional changes that simplify, improve maintainability, or squash warnings refactoring Code refactoring without any functional changes labels Jun 9, 2022
@kklobe kklobe force-pushed the kk/memory-static-alloc branch from fa83113 to 555be4c Compare June 9, 2022 02:38
@kklobe kklobe force-pushed the kk/memory-static-alloc branch from 555be4c to 3a64640 Compare June 9, 2022 02:52
Copy link
Member

@kcgen kcgen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice clean up, @kklobe !

@kklobe kklobe marked this pull request as ready for review June 9, 2022 03:33
@kklobe kklobe merged commit edd513e into main Jun 9, 2022
@kcgen kcgen deleted the kk/memory-static-alloc branch June 19, 2022 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Non-functional changes that simplify, improve maintainability, or squash warnings refactoring Code refactoring without any functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants