Borut Razem borut.razem@siol.net writes:
I was also thinking abut that. We could add a hProcess member to the ioinfo structure, but this means MSVCRT_MAX_FILES * sizeof(HANDLE) = 2048 * 4 = 8KB additional data space, which will be more then less unused...
That's not an issue, if it's unused the cost is minimal. The real problem is that the ioinfo structure can't be changed.
The problem is that "the highest file descriptor in use" (actually the number of popen calls during the process life) is not konwn in advance, that's why I implemented it as "dynamically growing array". Or I'm missing something?
You are confusing the allocation and the lookup. Yes, you need to grow it dynamically. That doesn't mean you need a linear search.