Win32: reduce environment array reallocations
commitc50f059a210810c41268e88334618a4469a09ffd
authorKarsten Blees <blees@dcon.de>
Sun, 15 Jan 2012 23:00:35 +0000 (16 00:00 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Tue, 19 Jun 2012 22:37:36 +0000 (19 23:37 +0100)
treef0f734af58f3bd8e82deedf42d056fb5d98d39f9
parentfc543eb4893f88efce5af14b563f3c50f032c357
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