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.
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()
© 2016 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.