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

Static init of the PS service #49

Merged
merged 3 commits into from
Feb 24, 2022
Merged

Static init of the PS service #49

merged 3 commits into from
Feb 24, 2022

Conversation

Meziu
Copy link
Member

@Meziu Meziu commented Feb 23, 2022

Related to #43.

With these changes, the PS service will run for the whole app runtime, and be destroyed at the program's end. This way all code using libc::getrandom (and thus, also std::collections::HashMap) will work by default when using ctru::init at the start of the program.

A similar problem to this would still arise when using std::net and other networking functionality without using the Soc service, but that one is way heavier than PS and it's only needed in very specific cases the user should be aware of.

Edit: Also, since these changes rend the idea of a Ps struct both useless and detrimental (like closing the service while some program process still needs it), the functions have been made statics of the ctru::ps module and the struct has been removed.

@AzureMarker

@Meziu Meziu requested a review from AzureMarker February 23, 2022 13:02
ctru-rs/examples/hashmaps.rs Outdated Show resolved Hide resolved
@Meziu Meziu merged commit 13eaba9 into master Feb 24, 2022
@AzureMarker AzureMarker deleted the fix/automatic-ps branch February 25, 2022 04:02
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.

2 participants