Skip to content
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

Loading a tasproj does not dispose the rewind buffer #3870

Open
Morilli opened this issue Mar 16, 2024 · 0 comments · May be fixed by #3935
Open

Loading a tasproj does not dispose the rewind buffer #3870

Morilli opened this issue Mar 16, 2024 · 0 comments · May be fixed by #3935

Comments

@Morilli
Copy link
Collaborator

Morilli commented Mar 16, 2024

Summary

When loading a tasproj from within TAStudio, the current rewind buffer is not disposed, meaning there will now be a rewind savestate buffer and the buffers from TAStudio loaded at the same time. That has no advantage whatsoever as rewind is disabled while TAStudio is active, and the buffer won't get filled with states until TAStudio is closed. Having that rewind buffer loaded the entire time is a waste of RAM.
This does not happen when loading TAStudio for the first time; the current rewind buffer is correctly disposed then.

Here's the order of operations in regards to MemoryBlock allocations + disposals when opening TAStudio, assuming rewind is currently enabled:

  1. A new MemoryBlock is allocated for the Current, Recent and Gaps areas respectively.
  2. Those 3 MemoryBlocks are then immediately disposed.
  3. A new MemoryBlock is allocated for the Current, Recent and Gaps areas respectively.
  4. The current rewind buffer is disposed.
  5. A new rewind buffer is allocated.
  6. The current (new) rewind buffer is disposed.

And what happens when a tasproj is loaded from within TAStudio (for example by just pressing New):

  1. A new MemoryBlock is allocated for the Current, Recent and Gaps areas respectively.
  2. Those 3 MemoryBlocks are then immediately disposed.
  3. A new MemoryBlock is allocated for the Current, Recent and Gaps areas respectively.
  4. The current rewind buffer is disposed.
  5. The current MemoryBlocks for the Current, Recent and Gaps areas are disposed.
  6. A new rewind buffer is allocated.

Clearly, the only problem here is that the newly created rewind buffer is not disposed again.
There is so much code involved in doing all these steps I honestly am afraid to touch any of it. Hopefully this documentation can help somehow.

@YoshiRulz YoshiRulz added the App: EmuHawk Relating to EmuHawk frontend label Mar 16, 2024
@Morilli Morilli linked a pull request Jun 3, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants