com.alicizax.unity.ui.exten.../Runtime/RecyclerView/ObjectPool/IObjectPool.cs
2025-05-28 19:37:38 +08:00

28 lines
681 B
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

namespace SimpleObjectPool
{
using System;
internal interface IObjectPool : IDisposable
{
/// <summary>
/// 从池子中分配一个可用对象,没有的话就创建一个
/// </summary>
/// <returns></returns>
object Allocate();
/// <summary>
/// 将对象回收到池子中去,如果池中的对象数量已经超过了 maxSize则直接销毁该对象
/// </summary>
/// <param name="obj"></param>
void Free(object obj);
}
internal interface IObjectPool<T> : IObjectPool, IDisposable where T : class
{
new T Allocate();
void Free(T obj);
}
}