summaryrefslogtreecommitdiff
path: root/Impostor-dev/src/Impostor.Hazel/IRecyclable.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Impostor-dev/src/Impostor.Hazel/IRecyclable.cs')
-rw-r--r--Impostor-dev/src/Impostor.Hazel/IRecyclable.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/Impostor-dev/src/Impostor.Hazel/IRecyclable.cs b/Impostor-dev/src/Impostor.Hazel/IRecyclable.cs
new file mode 100644
index 0000000..69be122
--- /dev/null
+++ b/Impostor-dev/src/Impostor.Hazel/IRecyclable.cs
@@ -0,0 +1,24 @@
+namespace Impostor.Hazel
+{
+ /// <summary>
+ /// Interface for all items that can be returned to an object pool.
+ /// </summary>
+ /// <threadsafety static="true" instance="true"/>
+ public interface IRecyclable
+ {
+ /// <summary>
+ /// Returns this object back to the object pool.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Calling this when you are done with the object returns the object back to a pool in order to be reused.
+ /// This can reduce the amount of work the GC has to do dramatically but it is optional to call this.
+ /// </para>
+ /// <para>
+ /// Calling this indicates to Hazel that this can be reused and thus you should only call this when you are
+ /// completely finished with the object as the contents can be overwritten at any point after.
+ /// </para>
+ /// </remarks>
+ void Recycle();
+ }
+}