optimize AllocMeasuredString