MINOR: tools: add memcpy_opt_small() for ultra-small copies
Some parsers need to copy many tiny objects of variable size (e.g. HTTP/1
chunks of a few bytes), for which calling the libc's memcpy() costs much
more than the copy itself, because the compiler cannot inline a copy
whose size it does not know.
memcpy_opt_small() copies sizes from 1 to 32 inline after two to four
tests, using at most two possibly overlapping fixed-size copies that the
compiler turns into simple loads and stores: one byte then 2 bytes at the
end for 1 to 3 bytes, then 4, 8 or 16 bytes at each end for 4 to 7, 8 to
16 and 17 to 32 bytes respectively. Larger sizes fall back to memcpy(). A
size of zero is not supported since one byte is always copied.