Win32: reduce environment array reallocations
commitb082e9a55d47e3d5f3d3286a954154ceebb7ebb2
authorKarsten Blees <blees@dcon.de>
Sun, 15 Jan 2012 23:00:35 +0000 (16 00:00 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 14 Feb 2012 20:04:10 +0000 (14 14:04 -0600)
tree10cc39119c9310da815bdd42cc4fda0ef9148969
parentb370c2e1731d3598cce8a97fb4a6e3d808ad7eac
Win32: reduce environment array reallocations

Move environment array reallocation from do_putenv to the respective
callers. Keep track of the environment size in a global variable. Use
ALLOC_GROW in mingw_putenv to reduce reallocations. Allocate a
sufficiently sized environment array in make_environment_block to prevent
reallocations.

Signed-off-by: Karsten Blees <blees@dcon.de>
compat/mingw.c