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

fix: memalign: respect malloc_alwaysinternal_limit (IDFGH-11209) #12375

Closed

Conversation

codysch
Copy link
Contributor

@codysch codysch commented Oct 9, 2023

This changes memalign (and posix_memalign) so that it uses an allocation method with the same selection criteria (checking malloc_alwaysinternal_limit and picking one of:

  • always MALLOC_CAP_INTERNAL
  • MALLOC_CAP_INTERNAL first with fallback
  • MALLOC_CAP_SPIRAM first with fallback

malloc_alwaysinternal_limit is in turn set by the options CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL and
CONFIG_SPRIAM_USE_CAPS_ALLOC.

This notably affects folks using esp-rs to build rust code for the esp-idf, as all allocations from rust use memalign.

@github-actions
Copy link

github-actions bot commented Oct 9, 2023

Messages
📖 Good Job! All checks are passing!

👋 Welcome codysch, thank you for your first contribution to espressif/esp-idf project!

📘 Please check Contributions Guide for the contribution checklist, information regarding code and documentation style, testing and other topics.

🖊️ Please also make sure you have read and signed the Contributor License Agreement for espressif/esp-idf project.

Pull request review and merge process you can expect

Espressif develops the ESP-IDF project in an internal repository (Gitlab). We do welcome contributions in the form of bug reports, feature requests and pull requests via this public GitHub repository.

  1. An internal issue has been created for the PR, we assign it to the relevant engineer
  2. They review the PR and either approve it or ask you for changes or clarifications
  3. Once the Github PR is approved, we synchronize it into our internal git repository
  4. In the internal git repository we do the final review, collect approvals from core owners and make sure all the automated tests are passing
    • At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
  5. If the change is approved and passes the tests it is merged into the master branch
  6. On next sync from the internal git repository merged change will appear in this public Github repository

Generated by 🚫 dangerJS against 9424d21

@espressif-bot espressif-bot added the Status: Opened Issue is new label Oct 9, 2023
@github-actions github-actions bot changed the title memalign: respect malloc_alwaysinternal_limit memalign: respect malloc_alwaysinternal_limit (IDFGH-11209) Oct 9, 2023
This changes `memalign` (and `posix_memalign`) so that it uses an
allocation method with the same selection criteria (checking
`malloc_alwaysinternal_limit` and picking one of:

 - always MALLOC_CAP_INTERNAL
 - MALLOC_CAP_INTERNAL first with fallback
 - MALLOC_CAP_SPIRAM first with fallback

`malloc_alwaysinternal_limit` is in turn set by the options
`CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL` and
`CONFIG_SPRIAM_USE_CAPS_ALLOC`.

This notably affects folks using esp-rs to build rust code for the
esp-idf, as all allocations from rust use `memalign`.
@codysch codysch force-pushed the memalign-internal-external-as-malloc branch from f3af259 to 9424d21 Compare October 9, 2023 22:18
@codysch codysch changed the title memalign: respect malloc_alwaysinternal_limit (IDFGH-11209) fix: memalign: respect malloc_alwaysinternal_limit (IDFGH-11209) Oct 9, 2023
@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development and removed Status: Opened Issue is new labels Oct 11, 2023
@espressif-bot espressif-bot added Status: Reviewing Issue is being reviewed and removed Status: Selected for Development Issue is selected for development labels Oct 19, 2023
@espressif-bot espressif-bot added Status: Done Issue is done internally Resolution: NA Issue resolution is unavailable and removed Status: Reviewing Issue is being reviewed labels Nov 2, 2023
espressif-bot pushed a commit that referenced this pull request Nov 7, 2023
This changes `memalign` (and `posix_memalign`) so that it uses an
allocation method with the same selection criteria (checking
`malloc_alwaysinternal_limit` and picking one of:

- always MALLOC_CAP_INTERNAL
- MALLOC_CAP_INTERNAL first with fallback
- MALLOC_CAP_SPIRAM first with fallback

`malloc_alwaysinternal_limit` is in turn set by the options
`CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL` and
`CONFIG_SPRIAM_USE_CAPS_ALLOC`.

This notably affects folks using esp-rs to build rust code for the
esp-idf, as all allocations from rust use `memalign`.

Merges #12375
@Alvin1Zhang
Copy link
Collaborator

Thanks for contribution again, changes merged with 9e1e245.

movsb pushed a commit to movsb/esp-idf that referenced this pull request Dec 1, 2023
This changes `memalign` (and `posix_memalign`) so that it uses an
allocation method with the same selection criteria (checking
`malloc_alwaysinternal_limit` and picking one of:

- always MALLOC_CAP_INTERNAL
- MALLOC_CAP_INTERNAL first with fallback
- MALLOC_CAP_SPIRAM first with fallback

`malloc_alwaysinternal_limit` is in turn set by the options
`CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL` and
`CONFIG_SPRIAM_USE_CAPS_ALLOC`.

This notably affects folks using esp-rs to build rust code for the
esp-idf, as all allocations from rust use `memalign`.

Merges espressif#12375
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants