tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: reallocarr(3)

Me wrote.
> You are right (at least for the num parameter). free(3) is fine then.
> Does memcpy(3) promise to preserve errno?
> My last suggestion is to move saved_errno = errno; before memcpy.
> And indeed, move reallocarray(3) to the _OPENBSD_SOURCE namespace.
> Regards,

Once a NetBSD developer told me that reallocarray is a confusing
name as there is no callocarray.

Just random thought, maybe call the new function rearray(3)?
It allocs, reallocs and frees. The name is short also without

The dictionary says:
: to place (a group of things) in a particular position so that
they are in order or so that they look attractive
: to dress (someone, especially yourself) in fine clothing
: to put (soldiers) in a place or position so that they are
ready to attack

:  to array again and say
that "rearray" is rarely used in C/C++ code.
Possible clash for pkgsrc with rearray is in net/coda.

Is it fine to have this function for the kernel too?


Home | Main Index | Thread Index | Old Index