replace it by cross-platform memcpy