glsl2: Add foreach_list_safe which works even when mutating the list.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 8 Jul 2010 20:06:22 +0000 (13:06 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 9 Jul 2010 16:46:07 +0000 (09:46 -0700)
commitf3290e950cd78a423d380b7e0a7aa18eb7718e27
tree9f134837e59bc40d35c9202805134596627519df
parentdfd30ca6a95a7d95835dad78ffe1fba4d1f4ef69
glsl2: Add foreach_list_safe which works even when mutating the list.

In particular, with foreach_list_safe, one can remove and free the current
node without crashes; if new nodes are added after the current node,
they will be properly visited as well.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
src/glsl/list.h