Avoid over allocations & reallocations
As we know, vectors amortize the cost of adding new elements by reserving space for multiple elements when full. This is useful but may lead to allocating more memory than necessary. `relibc` generally avoids over allocations by reserving the exact amount of space when possible. I fixed a few areas that still over allocated or reallocated unnecessarily by leveraging iterators that are more likely to know sizes.
parent
a45c7b26
No related branches found
No related tags found
Showing
- src/header/netdb/host.rs 6 additions, 13 deletionssrc/header/netdb/host.rs
- src/header/netdb/lookup.rs 45 additions, 41 deletionssrc/header/netdb/lookup.rs
- src/header/netdb/mod.rs 16 additions, 27 deletionssrc/header/netdb/mod.rs
- src/header/unistd/mod.rs 5 additions, 2 deletionssrc/header/unistd/mod.rs
- src/platform/linux/mod.rs 1 addition, 4 deletionssrc/platform/linux/mod.rs
- src/platform/redox/exec.rs 1 addition, 2 deletionssrc/platform/redox/exec.rs
Loading
Please register or sign in to comment