Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Freeing

Name: Anonymous 2008-12-29 1:26

Is there any real point in freeing memory these days? And I don't mean freeing memory for things that constantly grow and shrink in size. I mean freeing that one array that you malloc at the beginning of the program and you need it until the end of the program. What is the benefit of freeing it when it will be automatically freed by the operating system?

Name: Anonymous 2008-12-29 20:06

I don't think you know what are you talking about. All modern OS give zeroed out pages, both for RAM and for disk (this is why for some filesystems creating a file and writing to position 10000000000 takes a very long time: they don't support sparse files and have to fill it with zeros up to that position).
i'm >>8 and i didn't say operating systems don't do that. i said they shouldn't.

It would be a security hole if they didn't.
no, it'd be a security hole if your program relies on non-standard features of the operating system. if you have sensitive data in memory and want it to not stay there, you should zero it yourself.

>>27,31,34,35
gb2/pr/

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List