- Learning Rust
- Paul Johnson Vesa Kaihlavirta
- 89字
- 2021-07-02 23:07:25
Let's start at the beginning
In Chapter 2, Variables, I briefly mentioned how data is stored within memory, and I said that non-compound types, such as i32, are stored on the stack, whereas, the likes of String, Vector<T>, types, and such are stored on the heap.
By default, Rust stores data on the stack, as it's incredibly fast. There are drawbacks though. The stack is limited in size and the allocation only lasts for the lifetime of the function.
The question is, how much memory does a function take?
推薦閱讀
- 從零開始:數字圖像處理的編程基礎與應用
- 信息可視化的藝術:信息可視化在英國
- Python 深度學習
- Cross-platform Desktop Application Development:Electron,Node,NW.js,and React
- Spring Boot+Spring Cloud+Vue+Element項目實戰:手把手教你開發權限管理系統
- Python自然語言處理(微課版)
- Web Application Development with MEAN
- Easy Web Development with WaveMaker
- SAS數據統計分析與編程實踐
- 輕松上手2D游戲開發:Unity入門
- Illustrator CS6設計與應用任務教程
- AMP:Building Accelerated Mobile Pages
- Pandas入門與實戰應用:基于Python的數據分析與處理
- 深入理解C++11:C++11新特性解析與應用
- Yii框架深度剖析