Skip to content
  • Kenneth Graunke's avatar
    ralloc: Make rewrite_tail increase "start" by the new text's length. · 8292b741
    Kenneth Graunke authored
    
    
    Both callers of rewrite_tail immediately compute the new total string
    length by adding the (known) length of the existing string plus the
    length of the newly appended text.  Unfortunately, callers generally
    won't know the length of the new text, as it's printf-formatted.
    
    Since ralloc already computes this length, it makes sense to add it in
    and save the caller the effort.  This simplifies both existing callers,
    but more importantly, will allow for cheap-appending in the next commit.
    
    v2: The link_uniforms code needs both the old and new length.
        Apply the obvious fix (which sadly makes it less of a cleanup).
    
    Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
    Acked-by: José Fonseca <jfonseca@vmware.com> [v1]
    8292b741