Win32: reduce environment array reallocations
commit7f7702156965ef80f3b7f4b03c36a1d4b972d5f7
authorKarsten Blees <blees@dcon.de>
Sun, 15 Jan 2012 23:00:35 +0000 (16 00:00 +0100)
committerStepan Kasal <kasal@ucw.cz>
Thu, 15 May 2014 07:41:28 +0000 (15 09:41 +0200)
treea07963f5c009df8c035d043d3048dab25ee24a98
parent175ae6fefc8ccf6cd7ecc48b816dc78c885b4666
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