This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Avoid the use of mmap as buffer for stdio streams


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]