1 comment:
Patch Set #16, Line 497: bufsize = max(writecnt + 19, 261 + 19);
What do you want to drop? Just the change from 260+9 to 261+19 or the whole max()-line?
I meant dropping the max(). Just `bufsize = writecnt + 9` (or `+ 19`) would
have worked to. The optimization is only that with the max(), you probably
get less realloc() calls. But the overhead of realloc() (so far my impres-
sion) is insignificant in a program that does USB transfers (which have
a much higher overhead). I don't know but assume that this max(), and the
fewer realloc() calls, save us about 1us per flashrom run, in the best
case. (If this were a compute intensive program, avoiding realloc() would
make sense.)
And yes, starting with 4K and only increasing the buffer on demand would
work well. But then again, realloc() really isn't that expensive.
PS. Looked at PS11 now, that would work too. But needs a check that we
never exceed the buffer ofc.
To view, visit change 40477. To unsubscribe, or for help writing mail filters, visit settings.