Class BufferPool
- Namespace
- easyar
- Assembly
- EasyAR.Sense.dll
BufferPool implements a memory pool that can be used for functions such as custom camera access, which require repeatedly allocating memory of the same size, reducing the time spent on memory allocation.
public class BufferPool : RefBase, IDisposable
- Inheritance
-
BufferPool
- Implements
- Inherited Members
Constructors
BufferPool(int, int)
block_size is the byte size of each `Buffer`_. capacity is the maximum number of `Buffer`_.
public BufferPool(int block_size, int capacity)
Parameters
block_sizecapacity
Methods
Clone()
public BufferPool Clone()
CloneObject()
protected override object CloneObject()
block_size()
The byte size of each `Buffer`_.
public virtual int block_size()
capacity()
The maximum number of `Buffer`_.
public virtual int capacity()
size()
The current number of `Buffer`_ obtained externally.
public virtual int size()
tryAcquire()
Attempts to obtain a memory block. If the current number of `Buffer`_ obtained externally has not reached the maximum number of `Buffer`_, then takes out or allocates a new `Buffer`_, otherwise returns null.
public virtual Optional<Buffer> tryAcquire()