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

get_transfer_buffer is poor design #19

Open
JayFoxRox opened this issue Jul 25, 2018 · 0 comments
Open

get_transfer_buffer is poor design #19

JayFoxRox opened this issue Jul 25, 2018 · 0 comments

Comments

@JayFoxRox
Copy link
Member

get_transfer_buffer was added during review of #17 to avoid leaking memory.

However, this design is quite poor:

  • The buffer is never free'd and only grows. This means memory is wasted which might be necessary for other tasks while not transferring data. This would be especially bad when running in the background of a game.
  • Only a single buffer can be allocated and changing it's size makes it loose the content.
  • It's not thread safe.

Let me be clear: What we have works absolutely fine. But in the future we might want multiple buffers per transfer or we need to reduce the nxdk-rdt memory footprint. In those cases, this issue will become important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant