BufferPool Class

This type is an EasyAR Sense API in C#: BufferPool . Some descriptions may not apply to Unity environment on this page.

Some parts of the Sense API may have already been wrapped into Unity components, and directly usages may not be necessary.

Description

BufferPool is a memory pool to reduce memory allocation time consumption for functionality like custom camera interoperability, which needs to allocate memory buffers of a fixed size repeatedly.


Methods

.ctor

C#

public BufferPool(int block_size, int capacity)

block_size is the byte size of each Buffer .

capacity is the maximum count of Buffer .

block_size

C#

public virtual int block_size()

The byte size of each Buffer .

capacity

C#

public virtual int capacity()

The maximum count of Buffer .

size

C#

public virtual int size()

Current acquired count of Buffer .

tryAcquire

C#

public virtual Optional< Buffer > tryAcquire()

Tries to acquire a memory block. If current acquired count of Buffer does not reach maximum, a new Buffer is fetched or allocated, or else null is returned.