![]() |
Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
|
#include <qv4mm_p.h>
Public Types | |
enum | Blockness : quint8 { Unblocked , NormalBlocked , InCriticalSection } |
Public Member Functions | |
MemoryManager (ExecutionEngine *engine) | |
~MemoryManager () | |
template<typename ManagedType> | |
ManagedType::Data * | allocManaged (std::size_t size, Heap::InternalClass *ic) |
template<typename ManagedType> | |
ManagedType::Data * | allocManaged (Heap::InternalClass *ic) |
template<typename ManagedType> | |
ManagedType::Data * | allocManaged (std::size_t size, InternalClass *ic) |
template<typename ManagedType> | |
ManagedType::Data * | allocManaged (InternalClass *ic) |
template<typename ManagedType> | |
ManagedType::Data * | allocManaged (std::size_t size) |
template<typename ManagedType> | |
ManagedType::Data * | allocManaged () |
template<typename ObjectType> | |
ObjectType::Data * | allocateObject (Heap::InternalClass *ic) |
template<typename ObjectType> | |
ObjectType::Data * | allocateObject (InternalClass *ic) |
template<typename ObjectType> | |
ObjectType::Data * | allocateObject () |
template<typename ManagedType, typename Arg1> | |
ManagedType::Data * | allocWithStringData (std::size_t unmanagedSize, Arg1 &&arg1) |
template<typename ObjectType, typename... Args> | |
ObjectType::Data * | allocObject (Heap::InternalClass *ic, Args &&... args) |
template<typename ObjectType, typename... Args> | |
ObjectType::Data * | allocObject (InternalClass *ic, Args &&... args) |
template<typename ObjectType, typename... Args> | |
ObjectType::Data * | allocate (Args &&... args) |
template<typename ManagedType, typename... Args> | |
ManagedType::Data * | alloc (Args &&... args) |
void | runGC () |
bool | tryForceGCCompletion () |
void | runFullGC () |
void | dumpStats () const |
size_t | getUsedMem () const |
size_t | getAllocatedMem () const |
size_t | getLargeItemsMem () const |
void | changeUnmanagedHeapSizeUsage (qptrdiff delta) |
void | updateUnmanagedHeapSizeGCLimit () |
template<typename ManagedType> | |
ManagedType::Data * | allocIC () |
void | registerWeakMap (Heap::MapObject *map) |
void | registerWeakSet (Heap::SetObject *set) |
void | onEventLoop () |
void | setGCTimeLimit (int timeMs) |
MarkStack * | markStack () |
void | collectFromJSStack (MarkStack *markStack) const |
void | sweep (bool lastSweep=false, ClassDestroyStatsCallback classCountPtr=nullptr) |
void | cleanupDeletedQObjectWrappersInSweep () |
bool | isAboveUnmanagedHeapLimit () |
Static Public Member Functions | |
static constexpr std::size_t | align (std::size_t size) |
Public Attributes | |
QV4::ExecutionEngine * | engine |
ChunkAllocator * | chunkAllocator |
BlockAllocator | blockAllocator |
BlockAllocator | icAllocator |
HugeItemAllocator | hugeItemAllocator |
PersistentValueStorage * | m_persistentValues |
PersistentValueStorage * | m_weakValues |
QVector< Value * > | m_pendingFreedObjectWrapperValue |
Heap::MapObject * | weakMaps = nullptr |
Heap::SetObject * | weakSets = nullptr |
std::unique_ptr< GCStateMachine > | gcStateMachine {nullptr} |
std::unique_ptr< MarkStack > | m_markStack {nullptr} |
std::size_t | unmanagedHeapSize = 0 |
std::size_t | unmanagedHeapSizeGCLimit |
std::size_t | usedSlotsAfterLastFullSweep = 0 |
Blockness | gcBlocked = Unblocked |
bool | aggressiveGC = false |
bool | crossValidateIncrementalGC = false |
bool | gcStats = false |
bool | gcCollectorStats = false |
int | allocationCount = 0 |
size_t | lastAllocRequestedSlots = 0 |
struct { | |
size_t maxReservedMem = 0 | |
size_t maxAllocatedMem = 0 | |
size_t maxUsedMem = 0 | |
uint allocations [BlockAllocator::NumBins] | |
} | statistics |
Protected Member Functions | |
Heap::Base * | allocString (std::size_t unmanagedSize) |
expects size to be aligned | |
Heap::Base * | allocData (std::size_t size) |
Heap::Object * | allocObjectWithMemberData (const QV4::VTable *vtable, uint nMembers) |
Friends | |
template<typename ToBeMarked> | |
struct | GCCriticalSection |
QV4::MemoryManager::MemoryManager | ( | ExecutionEngine * | engine | ) |
|
inlinestaticconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 221 of file qv4mm_p.h.
References QV4::Heap::InternalClass::vtable.
|
inline |
|
inline |
|
inline |
|
protected |
|
protected |
|
inline |
void QV4::MemoryManager::cleanupDeletedQObjectWrappersInSweep | ( | ) |
|
inline |
void QV4::MemoryManager::registerWeakMap | ( | Heap::MapObject * | map | ) |
void QV4::MemoryManager::registerWeakSet | ( | Heap::SetObject * | set | ) |
void QV4::MemoryManager::sweep | ( | bool | lastSweep = false, |
ClassDestroyStatsCallback | classCountPtr = nullptr ) |
bool QV4::MemoryManager::tryForceGCCompletion | ( | ) |
Precondition: Incremental garbage collection must be currently active Finishes incremental garbage collection, unless in a critical section Code entering a critical section is expected to check if we need to force a gc completion, and to trigger the gc again if necessary when exiting the critcial section. Returns true
if the gc cycle completed, false otherwise.
void QV4::MemoryManager::updateUnmanagedHeapSizeGCLimit | ( | ) |
|
friend |
uint QV4::MemoryManager::allocations[BlockAllocator::NumBins] |
BlockAllocator QV4::MemoryManager::blockAllocator |
ChunkAllocator* QV4::MemoryManager::chunkAllocator |
bool QV4::MemoryManager::crossValidateIncrementalGC = false |
QV4::ExecutionEngine* QV4::MemoryManager::engine |
std::unique_ptr<GCStateMachine> QV4::MemoryManager::gcStateMachine {nullptr} |
HugeItemAllocator QV4::MemoryManager::hugeItemAllocator |
BlockAllocator QV4::MemoryManager::icAllocator |
std::unique_ptr<MarkStack> QV4::MemoryManager::m_markStack {nullptr} |
PersistentValueStorage* QV4::MemoryManager::m_persistentValues |
PersistentValueStorage* QV4::MemoryManager::m_weakValues |
struct { ... } QV4::MemoryManager::statistics |
std::size_t QV4::MemoryManager::usedSlotsAfterLastFullSweep = 0 |
Heap::MapObject* QV4::MemoryManager::weakMaps = nullptr |
Heap::SetObject* QV4::MemoryManager::weakSets = nullptr |