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

Fixes for improved RPL support #388

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Crementif
Copy link
Contributor

@Crementif Crementif commented Jul 6, 2024

@Exzap agreed upon me reviving his #325 PR with the suggested changes.

To rephrase his PR a bit, this is meant to address two problems that prevents RPLs from being usable:

  • LR isn't correctly restored in __rpl_start leading to an endless loop or crash. This PR adds the assembly that was missing.
  • The current behavior is that RPLs use wutmalloc, which assumes that MEMGetSizeForMBlockExpHeap can be used to determine the size when reallocating memory. This adds a separate wutmalloc implementation that only RPLs will use, which co-allocates a header alongside memory so that RPLs can now reallocate memory.

I've tested the changes with RPX files that both use the custom heap and override preinit_user to use the wutmalloc implementation. This PR allows Aroma plugins/modules to continue to have access to the regular malloc implementation, while RPLs are now fully functional. After that, follow up PRs can be made to address some of the minor issues that are left to complete the RPL support in wut.

Crementif added 2 commits July 5, 2024 22:40
Taken from devkitPro@92d343c but separated into its own header to ensure a fast path for wutmalloc users that don't need to co-live alongside non-SRBK heap implementations, like RPLs have to.
@Exzap Exzap mentioned this pull request Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant