]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sh: Move some stackmarks to fix high memory usage in some loops.
authorjilles <jilles@FreeBSD.org>
Sun, 20 Jan 2013 21:28:05 +0000 (21:28 +0000)
committerjilles <jilles@FreeBSD.org>
Sun, 20 Jan 2013 21:28:05 +0000 (21:28 +0000)
commit81fe037601c1afa5434d96fc45245aa4651d1fe9
tree6d0d47674786303c35822413e91e7f2da36f05d9
parent51fe15e2975672156b28514cc440be72cd1c9bd7
sh: Move some stackmarks to fix high memory usage in some loops.

If a loop contained certain commands (such as redirected compound commands),
the temporary memory for the redirection was not freed between iterations of
the loop but only after the loop.

Put a stackmark in evaltree(), freeing memory whenever a node has been
evaluated. Some other stackmarks are then redundant; remove them.

Example:
  while :; do { :; } </dev/null; done
bin/sh/eval.c