|
20 | 20 | // FIXME: Fill me in with more detail when the interface settles
|
21 | 21 | //! This library is built on the assumption of a few existing symbols:
|
22 | 22 | //!
|
23 |
| -//! * `memcpy`, `memcmp`, `memset`, `strlen` - These are core memory routines which are |
24 |
| -//! often generated by LLVM. Additionally, this library can make explicit |
25 |
| -//! calls to these functions. Their signatures are the same as found in C. |
26 |
| -//! These functions are often provided by the system libc, but can also be |
27 |
| -//! provided by the [compiler-builtins crate](https://crates.io/crates/compiler_builtins). |
| 23 | +//! * `memcpy`, `memmove`, `memset`, `memcmp`, `bcmp`, `strlen` - These are core memory routines |
| 24 | +//! which are generated by Rust codegen backends. Additionally, this library can make explicit |
| 25 | +//! calls to `strlen`. Their signatures are the same as found in C, but there are extra |
| 26 | +//! assumptions about their semantics: For `memcpy`, `memmove`, `memset`, `memcmp`, and `bcmp`, if |
| 27 | +//! the `n` parameter is 0, the function is assumed to not be UB. Furthermore, for `memcpy`, if |
| 28 | +//! source and target pointer are equal, the function is assumed to not be UB. |
| 29 | +//! (Note that these are [standard assumptions](https://reviews.llvm.org/D86993) among compilers.) |
| 30 | +//! These functions are often provided by the system libc, but can also be provided by the |
| 31 | +//! [compiler-builtins crate](https://crates.io/crates/compiler_builtins). |
| 32 | +//! Note that the library does not guarantee that it will always make these assumptions, so Rust |
| 33 | +//! user code directly calling the C functions should follow the C specification! The advice for |
| 34 | +//! Rust user code is to call the functions provided by this library instead (such as |
| 35 | +//! `ptr::copy`). |
28 | 36 | //!
|
29 | 37 | //! * `rust_begin_panic` - This function takes four arguments, a
|
30 | 38 | //! `fmt::Arguments`, a `&'static str`, and two `u32`'s. These four arguments
|
|
0 commit comments