Sebastian Lackner sebastian@fds-team.de writes:
- You decided to use exponential growth for the filenames buffer which
is better than allocating only one element at once. Nevertheless, it might still waste a lot of memory. I would suggest to use either linear growth or attempt to shrink the buffer size to release unnecessary space.
Exponential growth is almost always the right choice. That's even more true in cases like this where you can release the unused space at the end.