-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests, rework
UnixStr
-apis, add locked print (#22)
* Add more tests, rework `UnixStr`-apis, add locked print * Fixup epoll expect since using stdout in ci * Run CI on any push
- Loading branch information
1 parent
1ff7df1
commit b8c9e90
Showing
61 changed files
with
1,205 additions
and
1,182 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
name: "CI" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: {} | ||
push | ||
|
||
env: | ||
CI: true | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
@@ -1,25 +1,4 @@ | ||
use crate::platform::NULL_BYTE; | ||
|
||
pub mod strlen; | ||
#[cfg(test)] | ||
mod test; | ||
pub mod unix_str; | ||
|
||
/// Basic compare two null terminated strings | ||
/// # Safety | ||
/// Instant UB if these pointers are not null terminated | ||
#[inline] | ||
#[must_use] | ||
pub unsafe fn null_term_ptr_cmp_up_to(a: *const u8, b: *const u8) -> usize { | ||
let mut it = 0; | ||
loop { | ||
let a_val = a.add(it).read(); | ||
let b_val = b.add(it).read(); | ||
if a_val != b_val || a_val == NULL_BYTE { | ||
// Not equal, or terminated | ||
return it; | ||
} | ||
// Equal continue | ||
it += 1; | ||
} | ||
} |
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
Oops, something went wrong.