Win32: reduce environment array reallocations
commitf279242d5e3f17e01e1d70010c4f072798899a47
authorKarsten Blees <blees@dcon.de>
Thu, 17 Jul 2014 15:38:02 +0000 (17 17:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 Jul 2014 16:32:49 +0000 (21 09:32 -0700)
treeab6c63222623589d1ba5b57fe00a3a07685b89b1
parent77734da241f97607eea8f2bb55e0e19937e918d4
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>
Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.c