size_t size;
};
-static int loc_country_list_grow(struct loc_country_list* list, size_t size) {
+static int loc_country_list_grow(struct loc_country_list* list) {
+ size_t size = list->elements_size * 2;
+ if (size < 1024)
+ size = 1024;
+
DEBUG(list->ctx, "Growing country list %p by %zu to %zu\n",
list, size, list->elements_size + size);
// Check if we have space left
if (list->size >= list->elements_size) {
- int r = loc_country_list_grow(list, 64);
+ int r = loc_country_list_grow(list);
if (r)
return r;
}