replace some copy (set) loop with memcpy (memset)