add assert for memcpy overlapping