From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- Impostor-dev/src/Impostor.Hazel/IRecyclable.cs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Impostor-dev/src/Impostor.Hazel/IRecyclable.cs (limited to 'Impostor-dev/src/Impostor.Hazel/IRecyclable.cs') 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 +{ + /// + /// Interface for all items that can be returned to an object pool. + /// + /// + public interface IRecyclable + { + /// + /// Returns this object back to the object pool. + /// + /// + /// + /// 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. + /// + /// + /// 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. + /// + /// + void Recycle(); + } +} -- cgit v1.1-26-g67d0