Win32: reduce environment array reallocations
commitb2a0b3979815ec816b263920c6b033cf9d55c30b
authorKarsten Blees <blees@dcon.de>
Sun, 15 Jan 2012 23:00:35 +0000 (16 00:00 +0100)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 10 May 2014 21:56:31 +0000 (10 16:56 -0500)
treea07963f5c009df8c035d043d3048dab25ee24a98
parent6c7a47cbc9418d1426bfeaeb33077293bf0812de
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