lib: improve the performance of memcpy and memmove of the general version