Skip to content

Conversation

@nicholasbishop
Copy link
Member

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.
@nicholasbishop nicholasbishop force-pushed the bishop-from-str-with-buf-2 branch from 924244f to 1e3a74a Compare October 6, 2021 22:34
@GabrielMajeri GabrielMajeri self-assigned this Nov 27, 2021
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.

2 participants