This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] libio: Always use 8192 bytes as the default buffer size [BZ #4099]
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 3 Mar 2016 15:33:35 -0800 (PST)
- Subject: Re: [PATCH] libio: Always use 8192 bytes as the default buffer size [BZ #4099]
- Authentication-results: sourceware.org; auth=none
- References: <56D08C7C dot 9080806 at redhat dot com>
I think this should be split up and separate parts of it discussed
separately.
First, let's talk about the rationale for the wfiledoalloc.c changes.
Removing the unused cruft #include's and wrong comment are clearly fine.
Those don't belong with a functional change. Just do those first by
themselves.
You haven't described the rationale for using the narrow buffer size as the
byte size of the wide buffer. The existing rationale is fairly obvious:
each wchar_t might correspond to as few bytes as one, so multiplying the
narrow buffer size by sizeof (wchar_t) ensures that the wide buffer is
always big enough to contain the same file data as is the narrow buffer.
What is bad about that rationale and what is your better rationale for
making the two sizes equal?
Thanks,
Roland