Win32: reduce environment array reallocations
commitda6c3a796ad3cdd0e95d6df01fe25aae3908bd4b
authorKarsten Blees <blees@dcon.de>
Sun, 15 Jan 2012 23:00:35 +0000 (16 00:00 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 13 Mar 2012 05:47:58 +0000 (13 00:47 -0500)
treed3163859ff7bb022597b5b2583da3cdd68213173
parentea2b04d73d366fc4a4751b7972bab5b32048e1de
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