I have the following code in an object pool that implements the IEnumerable interface.
public IEnumerable ActiveNodes { get { for (int i
Also, you can have a pool of preallocated enumerators. Think about how many simultaneous enumerations you want to support.
The garbage collection overhead will go, at the expense of extra memory consumption. Speed vs. memory optimization dilemma in its purest form.