Win32: reduce environment array reallocations
commitbaf5b1833af7dc3d2b273e6f7b986a8c2f9d1ecd
authorKarsten Blees <blees@dcon.de>
Sun, 15 Jan 2012 23:00:35 +0000 (16 00:00 +0100)
committerKarsten Blees <blees@dcon.de>
Thu, 15 Mar 2012 17:21:46 +0000 (15 18:21 +0100)
treef07e93bdb7b722ac2c2f139b1967afefb6a789f2
parent9286ef390f8211d6a3e500117a58c358d843a324
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