-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make sure there are non-x86 alternatives for the x86 asm!
- Loading branch information
Showing
3 changed files
with
219 additions
and
204 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/// append `data` to `buf`, assuming `data` is less than 8 bytes and that `buf` has enough space | ||
/// remaining to hold all bytes in `data`. | ||
/// | ||
/// Safety: callers must ensure that `buf.capacity() - buf.len() >= data.len()`. | ||
#[inline(always)] | ||
pub unsafe fn append_string_lt_8_unchecked(buf: &mut alloc::string::String, data: &str) { | ||
buf.push_str(data); | ||
} | ||
|
||
/// append `data` to `buf`, assuming `data` is less than 16 bytes and that `buf` has enough space | ||
/// remaining to hold all bytes in `data`. | ||
/// | ||
/// Safety: callers must ensure that `buf.capacity() - buf.len() >= data.len()`. | ||
#[inline(always)] | ||
pub unsafe fn append_string_lt_16_unchecked(buf: &mut alloc::string::String, data: &str) { | ||
buf.push_str(data); | ||
} | ||
|
||
/// append `data` to `buf`, assuming `data` is less than 32 bytes and that `buf` has enough space | ||
/// remaining to hold all bytes in `data`. | ||
/// | ||
/// Safety: callers must ensure that `buf.capacity() - buf.len() >= data.len()`. | ||
#[inline(always)] | ||
pub unsafe fn append_string_lt_32_unchecked(buf: &mut alloc::string::String, data: &str) { | ||
buf.push_str(data); | ||
} |
Oops, something went wrong.