© Carlo Milanesi 2018
Carlo MilanesiBeginning Rusthttps://doi.org/10.1007/978-1-4842-3468-6_11

11. Allocating Memory

Carlo Milanesi1 
(1)
Bergamo, Italy
 
In this chapter, you will learn:
  • The various kinds of memory allocation, their performance characteristics, and their limitations

  • How to specify in Rust which memory allocation to use for an object

  • The difference between a reference and a Box

The Various Kinds of Allocation

To understand the Rust language, but also any other systems programming language , like the C language, it is important to understand well the various concepts of memory allocation, like static allocation, stack allocation, and heap allocation.

This chapter is entirely dedicated to such issues. In particular, we’ll see the four kinds ...

Get Beginning Rust: From Novice to Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.