Thread (2 messages) flat view 2 messages, 2 authors, 2016-06-15

Re: [PATCH] strbuf_write: omit system call when length is zero

From: Stefan Beller <hidden>
Date: 2016-06-15 23:08:30

On Thu, Feb 25, 2016 at 5:40 PM, Junio C Hamano [off-list ref] wrote:
Duy Nguyen [off-list ref] writes:
quoted
On Fri, Feb 26, 2016 at 5:34 AM, Stefan Beller [off-list ref] wrote:
quoted
In case the length of the buffer is zero, we do not need to call the
fwrite system call as a performance improvement.
fwrite is a libc call, not system call. Are you sure it always calls
write() (assuming buffering is off)?
I do not think so, but I suspect that the patch misstates its
rationale (I said I get uncomfortable every time I see a function
that takes size and nelem separately used by a caller that can
potentially pass nleme=0, when I wondered it it is OK that no caller
of this funtion checks its return value).
This is exactly what happened. I assumed fwrite would be a system call
eventually.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help