Use pointer trick to avoid memcpy