diff options
| author | bors <bors@rust-lang.org> | 2021-01-22 21:48:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-01-22 21:48:41 +0000 |
| commit | 34b3d41e1ad74983943c05e382a1750cdf6d2b33 (patch) | |
| tree | b59246c8914a5623eab8e4cabeba319ac7d91574 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 22ddcd1a13082b7be0fc99b720677efd2b733816 (diff) | |
| parent | 7d102383f97c1616cffce5ca72ff12eabd9603bf (diff) | |
| download | rust-34b3d41e1ad74983943c05e382a1750cdf6d2b33.tar.gz rust-34b3d41e1ad74983943c05e382a1750cdf6d2b33.zip | |
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!
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
