2017-12-30 12:00:14 +00:00
|
|
|
% The Stack and the Heap
|
2017-03-03 14:50:30 +00:00
|
|
|
|
2017-12-31 03:21:47 +00:00
|
|
|
<small>There is a new edition of the book and this is an old link.</small>
|
2017-12-31 01:56:24 +00:00
|
|
|
|
|
|
|
> Both the stack and the heap are parts of memory that is available to your code to use at runtime, but they are structured in different ways.
|
|
|
|
> The stack stores values in the order it gets them and removes the values in the opposite order.
|
|
|
|
> All data on the stack must take up a known, fixed size.
|
|
|
|
> For data with a size unknown to us at compile time or a size that might change, we can store data on the heap instead.
|
|
|
|
|
|
|
|
---
|
|
|
|
|
2018-11-20 22:59:52 +00:00
|
|
|
You can find the latest version of this information
|
|
|
|
[here](ch04-01-what-is-ownership.html#the-stack-and-the-heap).
|