Skip to content

Commit 92998fb

Browse files
authored
Remove note on builtin memory optimizations
The referenced issue in compiler-builtins (rust-lang/compiler-builtins#365) has been merged.
1 parent 54a0c2b commit 92998fb

File tree

1 file changed

+1
-3
lines changed
  • blog/content/edition-2/posts/02-minimal-rust-kernel

1 file changed

+1
-3
lines changed

blog/content/edition-2/posts/02-minimal-rust-kernel/index.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,10 @@ build-std-features = ["compiler-builtins-mem"]
310310

311311
(Support for the `compiler-builtins-mem` feature was only [added very recently](https://github.com/rust-lang/rust/pull/77284), so you need at least Rust nightly `2020-09-30` for it.)
312312

313-
Behind the scenes, this flag enables the [`mem` feature] of the `compiler_builtins` crate. The effect of this is that the `#[no_mangle]` attribute is applied to the [`memcpy` etc. implementations] of the crate, which makes them available to the linker. It's worth noting that these functions are [not optimized] right now, so their performance might not be the best, but at least they are correct. For `x86_64`, there is an open pull request to [optimize these functions using special assembly instructions][memcpy rep movsb].
313+
Behind the scenes, this flag enables the [`mem` feature] of the `compiler_builtins` crate. The effect of this is that the `#[no_mangle]` attribute is applied to the [`memcpy` etc. implementations] of the crate, which makes them available to the linker.
314314

315315
[`mem` feature]: https://github.com/rust-lang/compiler-builtins/blob/eff506cd49b637f1ab5931625a33cef7e91fbbf6/Cargo.toml#L54-L55
316316
[`memcpy` etc. implementations]: https://github.com/rust-lang/compiler-builtins/blob/eff506cd49b637f1ab5931625a33cef7e91fbbf6/src/mem.rs#L12-L69
317-
[not optimized]: https://github.com/rust-lang/compiler-builtins/issues/339
318-
[memcpy rep movsb]: https://github.com/rust-lang/compiler-builtins/pull/365
319317

320318
With this change, our kernel has valid implementations for all compiler-required functions, so it will continue to compile even if our code gets more complex.
321319

0 commit comments

Comments
 (0)