-
Notifications
You must be signed in to change notification settings - Fork 132
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX: Support uninitalized data in encode_utf8, and update try_push
We were using &mut [u8] in encode_utf8, but this is not right according to the developing unsafe coding guidelines. We need to use raw pointers to write to possibly uninit memory. We use a raw pointer form for encode_utf8. It was first attempted to encapsulate the trusted-to-be-valid raw pointer in a simple { *mut u8, usize } struct, but the current way of passing ptr and len separately was the only way to not regress performance. This impl maintains the same performance in arraystring benches. Add exhaustive-style tests for encode_utf8
- Loading branch information
Showing
2 changed files
with
62 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters