[vlc-devel] [RFC 3/3] vlc_arrays: append items in amortized O(1)

Filip Roséen filip at atch.se
Thu Jul 19 18:38:18 CEST 2018

Hi Romain,

On 2018-07-19 17:57, Romain Vimont wrote:

> +static inline void *vlc_realloc(void *ptr, size_t count, size_t size)
> +{
> +    return mul_overflow(count, size, &size) ? NULL : realloc(ptr, size);
> +}

Why name this `vlc_realloc` when it is really an implementation of
`reallocarray`? To me it makes little to no sense.

If you want an implementation that behaves and accepts the same
arguments as `reallocarray`, I'd argue that you definitely should not
name it after something both *standard*, and with a different
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20180719/10e9f51a/attachment.html>

More information about the vlc-devel mailing list