#3017: change-folder: tab-completion results in "Out of memory!", return value = 1 if many files for the menu
Changes (by pdmef): * keywords: => file browser Comment: > I haven't tried yet with the fix, but I've recompiled Mutt with -ftrapv in CFLAGS, and I get the "Out of memory" error before the integer overflow, perhaps of all these realloc's? (Instead of adding 256, I think that multiplying by some factor would be better.) Hmm, that doesn't work here. Increasing by a (constant?) factor means the table grows exponentially, e.g. n^2 for a factor of 2? That would waste quite a lot of space for browsing larger dirs, e.g. when you have a table size of 16k, need just a few more files you'd double it to 32k entries. In such a case, such a table is twice as large as needed. Though I don't have any hard numbers, I doubt just a couple of realloc/memset make the situation much better for the average case (I'm not sure, but browsing a dir from within mutt containing several 10k files is not what the regular mutt user does, I guess). I tested such a scheme for maildir speedup using a table incremented by a factor 1.5 instead of a single-linked list, it made nearly no difference speed-wise. Rocco -- Ticket URL: <http://dev.mutt.org/trac/ticket/3017#comment:6>
