Skip to content
  • René Scharfe's avatar
    add MOVE_ARRAY · 57839807
    René Scharfe authored and Junio C Hamano's avatar Junio C Hamano committed
    Similar to COPY_ARRAY (introduced in 60566cbb
    
    ), add a safe and
    convenient helper for moving potentially overlapping ranges of array
    entries.  It infers the element size, multiplies automatically and
    safely to get the size in bytes, does a basic type safety check by
    comparing element sizes and unlike memmove(3) it supports NULL
    pointers iff 0 elements are to be moved.
    
    Also add a semantic patch to demonstrate the helper's intended usage.
    
    Signed-off-by: default avatarRene Scharfe <l.s.r@web.de>
    Signed-off-by: default avatarJunio C Hamano <gitster@pobox.com>
    57839807