replace own functions with mem{cmp,cpy}