This commit is contained in:
austin 2021-11-16 17:27:03 +08:00
parent c2dd95afab
commit a19fe4bac3
1 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
个人认为好的程序员总是会合理的使用内存学习数据结构也需要对C语言的内存管理做个简单的了解为什么是简单的了解而不是深入呢因为C语言及其内存管理不是三言两语可以说清的这里我们只谈谈常用的内存管理方法。
## 什么是malloc
## 什么是malloc
以往我们在学习c语言时通常只是简单的使用intfloat之类来声明变量。像这种变量通常存放在栈区stack由编译器自动分配释放存放函数的参数值局部变量等值。而在实际编程中我们需要足够的内存来保证程序的存储需求由于stack区内存相对较小所以我们需要使用malloc与free等函数来从堆区heap动态申请与释放内存堆区要比栈区大得多。
@ -130,5 +130,4 @@ collect2: error: ld returned 1 exit status
yum install devtoolset-9-libasan-devel libssan
```
[1]: https://lookcos.cn/usr/uploads/2021/11/2076423197.png
[1]: https://lookcos.cn/usr/uploads/2021/11/2076423197.png