rust/library/alloc
bors 34b3d41e1a Auto merge of #79233 - yoshuawuyts:alloc-doc-alias, r=GuillaumeGomez
Add doc aliases for memory allocations

This patch adds doc aliases for various C allocation functions, making it possible to search for the C-equivalent of a function and finding the (safe) Rust counterpart:

- `Vec::with_capacity` / `Box::new` / `vec!` -> alloc + malloc, allocates memory
- `Box::new_zeroed` -> calloc, allocates zeroed-out memory
- `Vec::{reserve,reserve_exact,try_reserve_exact,shrink_to_fit,shrink_to}` -> realloc, reallocates a previously allocated slice of memory

It's worth noting that `Vec::new` does not allocate, so we don't link to it. Instead people are probably looking for `Vec::with_capacity` or `vec!`. I hope this will allow people comfortable with the system allocation APIs to make it easier to find what they may be looking for.

Thanks!
2021-01-22 21:48:41 +00:00
..
benches
src Auto merge of #79233 - yoshuawuyts:alloc-doc-alias, r=GuillaumeGomez 2021-01-22 21:48:41 +00:00
tests Fix soundness issue for replace_range and range 2021-01-18 22:14:38 -05:00
Cargo.toml Update compiler_builtins to 0.1.39 2021-01-07 16:16:36 +09:00