Skip to content

Glossary: Rust in Practice

allocation

Also written: allocations, allocate

Asking the system for a piece of memory, as every new `String` does. Many allocations in a hot loop make code slow, which is why code that borrows `&str` instead of copying into new `String`s runs faster.

Where the book teaches it

Related terms

hot loop