On Sat, Jun 12, 2010 at 01:13:32PM +0100, Ethan Grammatikidis wrote:
On 12 Jun 2010, at 12:07, Kris Maglione wrote:
Yes, it does. Hugely. But, on the other hand, it's the entire basis of modern malloc implementatons and dynamic linking and loading.

I can see dynamic linking needing to load from file on fault, but malloc puzzles me. I wonder if it is the way it is just because that's a good way to make it fit with the page-fault-loading of dynamic linking and mmap.

mmap isn't just for files. malloc used to be based on sbrk, it had the drawback that freed memory couldn't be released to the kernel if there was anything allocated after it. mmapped memory can be unmapped whenever an entire page is freed (and fancy malloc libs tend to place non-addressable pages at the end of allocations these days to catch overflows).

--
Kris Maglione

Plenty of kind, decent, caring people have no religious beliefs, and
they act out of the goodness of their hearts.  Conversely, plenty of
people who profess to be religious, even those who worship regularly,
show no particular interest in the world beyond themselves.
        --John Danforth, priest, ambassador, senator (b. 1936)


Reply via email to