Why not a realloc which just fails if it has to copy?
Is it good enough to realloc down to the number of bytes you’d want copying, and then realloc up to your desired buffer size?
Why not a realloc which just fails if it has to copy?