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

Add CStr16::from_str_with_buf #291

Merged

Conversation

nicholasbishop
Copy link
Contributor

This provides an easy way to convert from a UTF-8 str to a CStr16
without requiring allocation. You just have to provide a backing buffer
large enough to store the converted characters.

Also converted the runtime vars test to use this method instead of
CString16, since if the runtime tests are ever moved to run after
exiting boot services, they won't be able to use allocation.

This provides an easy way to convert from a UTF-8 str to a CStr16
without requiring allocation. You just have to provide a backing buffer
large enough to store the converted characters.

Also converted the runtime vars test to use this method instead of
`CString16`, since if the runtime tests are ever moved to run after
exiting boot services, they won't be able to use allocation.
Copy link
Collaborator

@GabrielMajeri GabrielMajeri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@GabrielMajeri GabrielMajeri changed the title Add CStr16::from_str_with_buf Add CStr16::from_str_with_buf Nov 27, 2021
@GabrielMajeri GabrielMajeri merged commit 5be61ad into rust-osdev:master Nov 27, 2021
@nicholasbishop nicholasbishop deleted the bishop-from-str-with-buf-2 branch December 12, 2021 21:39
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.

None yet

2 participants