Skip to content

Commit

Permalink
Add IPool interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Exanite committed Jan 26, 2025
1 parent 1b4095c commit 7bc5049
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
16 changes: 16 additions & 0 deletions Pooling/IPool.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Exanite.Core.Runtime;

namespace Exanite.Core.Pooling
{
public interface IPool<T> : ITrackedDisposable
{
public PoolUsageInfo UsageInfo { get; }

public Pool<T>.Handle Acquire(out T value);
public T Acquire();

public void Release(T element);

public void Clear();
}
}
2 changes: 1 addition & 1 deletion Pooling/Pool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public abstract class Pool : ITrackedDisposable
/// <summary>
/// Conventional object pool where objects can be acquired and released.
/// </summary>
public class Pool<T> : Pool
public class Pool<T> : Pool, IPool<T>
{
private readonly Queue<T> values;

Expand Down

0 comments on commit 7bc5049

Please sign in to comment.