Win32: reduce environment array reallocations
commitb2e6cddf49f32ea64dec47b34ec33a435e85f685
authorKarsten Blees <blees@dcon.de>
Sun, 15 Jan 2012 23:00:35 +0000 (16 00:00 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Fri, 11 May 2012 22:50:04 +0000 (11 17:50 -0500)
tree2397a522cd48cdeb5bd475143b20a3b3af418348
parent6fd39ad7c885d6b7999c07dbb3ca61d8af562577
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