nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] discard() declared eeevil

2011-12-26 19:29:44
On Mon, Dec 26, 2011 at 20:19, <Valdis(_dot_)Kletnieks(_at_)vt(_dot_)edu> wrote:

On Mon, 26 Dec 2011 14:35:18 PST, Lyndon Nerenberg said:

sbr/discard.c contains a rather evil piece of code that gropes around
 inside of stdio's FILE struct.

Also, m_getfld.c contains similar poltergeist activities.

"-EGADS - violates the principle of least surprise" -- Casey Schaufler

The 'ifdef LINUX_STDIO' in discard.c can probably die, as we seem to have
an
fpurge() function in glibc since 2.1.95.  Anybody still running a glibc
older
than that deserves to not have nice things.

Not sure what m_getfld.c is doing there.  Something underhanded, I suspect.


If I remember right, m_getfld.c tries to eek the most performance out of
header field scanning by taking advantage of knowledge of the stdio
structures to peek further into the buffer and do an optimized ungetc().

That was necessary in the days when a VAX was fast.  But these days my cell
phone is faster than a room full of VAXen and we could re-write the code to
be more readable and no-one would know the difference.

Thanks

Jeff

-- 
Jeffrey C. Honig <jch(_at_)honig(_dot_)net>
http://www.honig.net/jch
GnuPG ID:14E29E13 <http://www.honig.net/jch/key.shtml>



_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers


_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers
<Prev in Thread] Current Thread [Next in Thread>