且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

为什么free()不能真正释放内存?

更新时间:2023-02-02 15:07:55

free不一定会将内存释放回操作系统.大多数情况下,它只是将该内存区域放回空闲块列表中.这些空闲的块可重新用于下一次malloc的调用.

free does not necessarily release the memory back to the operating system. Most often it just puts back that memory area in a list of free blocks. These free blocks could be reused for the next calls to malloc.