What is the advantage of using GenericPool over simply using a custom static Stack?

Since it’s very easy to make your own pool using a static Stack<T>, why would anyone want to use GenericPool<T>? Is there any special advantage?

When you check the Documentation-Page (which i can only always always recommend in these cases) you can see that it states:

  The GenericPool has collection checks enabled that ensure that when an instance is released it is not already in the pool. Note this is not thread-safe

So, yes you can use a Stack to create a new class that has the same behaviour, but in general it is already provided to you.