3rd Eye Scene C#
3rd Eye Scene C# documentation
|
Classes | |
class | Bucket |
Provides a thread-safe bucket containing buffers that can be Rent'd and Return'd. | |
Public Member Functions | |
override T[] | Rent (int minimumLength) |
Retrieves a buffer that is at least the requested length. | |
override void | Return (T[] array, bool clearArray=false) |
Returns to the pool an array that was previously obtained via Rent on the same ArrayPool{T} instance. |
override T [] Tes::Buffers::DefaultArrayPool< T >::Rent | ( | int | minimumLength | ) | [inline, virtual] |
Retrieves a buffer that is at least the requested length.
minimumLength | The minimum length of the array needed. |
This buffer is loaned to the caller and should be returned to the same pool via Return so that it may be reused in subsequent usage of Rent. It is not a fatal error to not return a rented buffer, but failure to do so may lead to decreased application performance, as the pool may need to create a new buffer to replace the one lost.
Implements Tes::Buffers::ArrayPool< T >.
override void Tes::Buffers::DefaultArrayPool< T >::Return | ( | T[] | array, |
bool | clearArray = false |
||
) | [inline, virtual] |
Returns to the pool an array that was previously obtained via Rent on the same ArrayPool{T} instance.
array | The buffer previously obtained from Rent to return to the pool. |
clearArray | If true and if the pool will store the buffer to enable subsequent reuse, Return will clear array of its contents so that a subsequent consumer via Rent will not see the previous consumer's content. If false or if the pool will release the buffer, the array's contents are left unchanged. |
Once a buffer has been returned to the pool, the caller gives up all ownership of the buffer and must not use it. The reference returned from a given call to Rent must only be returned via Return once. The default ArrayPool{T} may hold onto the returned buffer in order to rent it again, or it may release the returned buffer if it's determined that the pool already has enough buffers stored.
Implements Tes::Buffers::ArrayPool< T >.