What happens to memory after free()?

后端 未结 4 1675
你的背包
你的背包 2020-12-03 23:07

I know that on you hard drive, if you delete a file, the data is not (instantly) gone. The data is still there until it is overwritten. I was wondering if a similar concept

4条回答
  •  失恋的感觉
    2020-12-03 23:27

    Generally, it does stay around, unless you explicitly overwrite the string before freeing it (like people sometimes do with passwords). Some library implementations automatically overwrite deallocated memory to catch accesses to it, but that is not done in release mode.

提交回复
热议问题