Re: [PATCH 1/2] add MOVE_ARRAY

2017-07-16 Thread Jeff King
On Sat, Jul 15, 2017 at 09:36:20PM +0200, René Scharfe wrote: > Similar to COPY_ARRAY (introduced in 60566cbb58), 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

[PATCH 1/2] add MOVE_ARRAY

2017-07-15 Thread René Scharfe
Similar to COPY_ARRAY (introduced in 60566cbb58), 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

[PATCH 1/2] add MOVE_ARRAY

2017-04-07 Thread René Scharfe
Add MOVE_ARRAY to complement COPY_ARRAY, which was added in 60566cbb. It provides the same convenience, safety and support for NULL pointers as representations of empty arrays, just as a wrapper for memmove(3) instead of memcpy(3). Inspired-by: Martin Liska Signed-off-by: Rene