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 |
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.