Avoid memcpy completely

Change-Id: I3d27935918930af71f02354696134def6bd052b6