Static memory allocation

While we have the stack and heap, Rust also has another type of memory allocation, that is, statically allocated memory. This is not allocated at runtime, but moves into memory with the program's code before the program is run.

The likes of static and const variables are good examples of static allocations.

Static memory allocation has the same lifetime as that of the application.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset