Table of Contents

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 memory allocation time.

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_size
capacity

Methods

Clone()

public BufferPool Clone()

Returns

CloneObject()

protected override object CloneObject()

Returns

block_size()

the byte size of each `Buffer`_.

public virtual int block_size()

Returns

capacity()

the maximum number of `Buffer`_.

public virtual int capacity()

Returns

size()

the current number of externally obtained `Buffer`_.

public virtual int size()

Returns

tryAcquire()

Attempts to obtain a memory block. If the current number of externally obtained `Buffer`_ has not reached the maximum number of `Buffer`_, an existing or a new `Buffer`_ is taken or allocated; otherwise, returns null.

public virtual Optional<Buffer> tryAcquire()

Returns