[patch] Avoid the use of mmap as buffer for stdio streams
Wolfram Gloger
wmglo@dent.med.uni-muenchen.de
Sat Nov 25 18:40:00 GMT 2006
Hi,
> 1) it's now no longer a good idea to use fopen and friends inside the
> malloc() implementation (that doesn't seem to happen anyway)
That cannot happen, not even in a custom malloc implementation,
because fopen already calls malloc for its FILE object..
However, I just re-read the discussion from December 1996 (wow,
we're approaching 10 years of glibc, where's the party BTW?).
The reason to switching to mmap() for file buffers was the fact that a
zeroed buffer is required. Before the switch to mmap, calloc() was
used and _this_ was not present in all custom malloc implementations,
notably bash's at the time.
Although I think "custom mallocs not providing calloc()" is by now
probably not a very strong argument, the fact that zeroed memory is
required somewhat weakens the disadvantages of using mmap.
Regards,
Wolfram.
More information about the Libc-alpha
mailing list