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

Denis Charmet typx at dinauz.org
Sun Jul 22 18:19:00 CEST 2018


Hi,

On 2018-07-22 14:08, Rémi Denis-Courmont wrote:
> Le jeudi 19 juillet 2018, 18:57:18 EEST Romain Vimont a écrit :
>> typedef struct vlc_array_t
>>  {
>> +    size_t i_capacity;
> 
> AFAICT, a new member is not really necessary.
> 
> If you allocated by power of two, it'd be easy to detect when to 
> expand/shrink
> the allocation.

Don't you fear that the exponential growth could cause other issues?

Regards,
-- 
Denis Charmet - TypX
Le mauvais esprit est un art de vivre


More information about the vlc-devel mailing list