Skip to content

ZeroDMA: Allocate descriptors from local buffer #247

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Timvrakas
Copy link

  • memalign() is deprecated
  • In the current configuration, free()ing the memory is left to the user, but very little warning is given
  • manual free() is not a common pattern within the Arduino Ecosystem. Most things are either static, or RAII-allocated as part of C++ classes.
  • addDescriptor() always returns a pointer, and doesn't tell the user if that pointer was heap-allocated or part of the static _descriptor structure. This would make a correct user implementation very difficult.
  • In threaded/tasked systems, multiple tasks may try to memalign() concurrently. I don't have faith the built-in malloc() is thread-safe.
  • malloc() time is non-deterministic
  • Even on the largest SAMD51, the entire SRAM could be moved with only 4 descriptors. I think applications with involving that much data would be rare, and the #define override would allow easy adjustment.
  • This change does not effect any APIs

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant