QFrameAllocator Class | Qt3D Module 5.5

- Qt 5.5
- Qt3D Module
- C++ Classes
- QFrameAllocator
- Qt 5.5.1 Reference Documentation

# QFrameAllocator Class

(Qt3D::QFrameAllocator)

Provides a pool of memory chunks to be used to allocate objects on a per frame basis. More...

Header: | #include <QFrameAllocator>
qmake: | QT += 3dcore

- List of all members, including inherited members

## Public Functions

| QFrameAllocator(uint maxObjectSize, uint alignment = 16, uint pageSize = 128)
| ~QFrameAllocator()
T * | allocate()
void * | allocateRawMemory(size_t size)
int | allocatorPoolSize() const
void | clear()
void | deallocate(T * ptr)
void | deallocateRawMemory(void * ptr, size_t size)
bool | isEmpty() const
uint | maxObjectSize() const
uint | totalChunkCount() const
void | trim()

## Detailed Description

Provides a pool of memory chunks to be used to allocate objects on a per frame basis.

The memory can be recycled by following frames by calling clear which won't deallocate any memory.

Note: Be really careful when allocating polymorphic types. You must be sure to call deallocate with the subclass type to properly release all memory.

## Member Function Documentation

### QFrameAllocator::QFrameAllocator(uint maxObjectSize, uint alignment = 16, uint pageSize = 128)

### QFrameAllocator::~QFrameAllocator()

### T * QFrameAllocator::allocate()

### void * QFrameAllocator::allocateRawMemory(size_t size)

### int QFrameAllocator::allocatorPoolSize() const

### void QFrameAllocator::clear()

### void QFrameAllocator::deallocate(T * ptr)

### void QFrameAllocator::deallocateRawMemory(void * ptr, size_t size)

### bool QFrameAllocator::isEmpty() const

### uint QFrameAllocator::maxObjectSize() const

### uint QFrameAllocator::totalChunkCount() const

### void QFrameAllocator::trim()