aboutsummaryrefslogtreecommitdiff
path: root/Tools/Hazel-Networking/Hazel/IRecyclable.cs
blob: 3e9769e70d1b87d78c10d79a08ca8bb70f71c04d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace 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();
    }
}