]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Memory allocation optimization
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 29 Apr 2016 09:34:23 +0000 (12:34 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Fri, 29 Apr 2016 09:34:23 +0000 (12:34 +0300)
src/lib-index/mail-index-map.c

index de422cbabf3de77ecac7dd942bdbaf7dafab13ba..52f9ad02abfe0fd3335d68487cc58fbaadf0840f 100644 (file)
@@ -327,7 +327,7 @@ static void mail_index_map_copy_records(struct mail_index_record_map *dest,
        size_t size;
 
        size = src->records_count * record_size;
-       dest->buffer = buffer_create_dynamic(default_pool, I_MIN(size, 1024));
+       dest->buffer = buffer_create_dynamic(default_pool, I_MAX(size, 1024));
        buffer_append(dest->buffer, src->records, size);
 
        dest->records = buffer_get_modifiable_data(dest->buffer, NULL);