Why doesn't free() zero out the memory prior to releasing it?

后端 未结 14 2967
长情又很酷
长情又很酷 2020-12-15 12:17

When we free() memory in C, why is that memory not filled with zero? Is there a good way to ensure this happens as a matter of course when calling free()<

14条回答
  •  北荒
    北荒 (楼主)
    2020-12-15 12:45

    C why is the memory not explictly set to zero in the free implementation .

    Because of speed.

    Because after we free the memory any how we set it to zero after freeing.

    Eh?

提交回复
热议问题