sources: reallocate arrays in exponentially increasing sizes
This commit is contained in:
parent
4e0df8c2a6
commit
b5a85bd2fe
1 changed files with 1 additions and 1 deletions
|
@ -207,7 +207,7 @@ SRC_Instance SRC_CreateNewInstance(uint32_t ref_id, SRC_Type type, SRC_SelectOpt
|
|||
|
||||
if (n_sources == max_n_sources) {
|
||||
/* Reallocate memory */
|
||||
max_n_sources += 32;
|
||||
max_n_sources = max_n_sources > 0 ? 2 * max_n_sources : 4;
|
||||
if (sources) {
|
||||
sources = ReallocArray(struct SRC_Instance_Record *, max_n_sources, sources);
|
||||
sort_list = ReallocArray(struct Sort_Element, 3*max_n_sources, sort_list);
|
||||
|
|
Loading…
Reference in a new issue