minor improvement to text buffer allocation