diff options
Diffstat (limited to 'src/qml/memory/qv4mm_p.h')
-rw-r--r-- | src/qml/memory/qv4mm_p.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/qml/memory/qv4mm_p.h b/src/qml/memory/qv4mm_p.h index e16a0ca544..fb21481d5b 100644 --- a/src/qml/memory/qv4mm_p.h +++ b/src/qml/memory/qv4mm_p.h @@ -58,8 +58,6 @@ #include <private/qv4mmdefs_p.h> #include <QVector> -//#define DETAILED_MM_STATS - #define QV4_MM_MAXBLOCK_SHIFT "QV4_MM_MAXBLOCK_SHIFT" #define QV4_MM_MAX_CHUNK_SIZE "QV4_MM_MAX_CHUNK_SIZE" #define QV4_MM_STATS "QV4_MM_STATS" @@ -122,9 +120,6 @@ struct BlockAllocator { : chunkAllocator(chunkAllocator), engine(engine) { memset(freeBins, 0, sizeof(freeBins)); -#if MM_DEBUG - memset(allocations, 0, sizeof(allocations)); -#endif } enum { NumBins = 8 }; @@ -133,10 +128,6 @@ struct BlockAllocator { return nSlots >= NumBins ? NumBins - 1 : nSlots; } -#if MM_DEBUG - void stats(); -#endif - HeapItem *allocate(size_t size, bool forceAllocation = false); size_t totalSlots() const { @@ -166,9 +157,7 @@ struct BlockAllocator { ChunkAllocator *chunkAllocator; ExecutionEngine *engine; std::vector<Chunk *> chunks; -#if MM_DEBUG - uint allocations[NumBins]; -#endif + uint *allocationStats = nullptr; }; struct HugeItemAllocator { @@ -453,10 +442,6 @@ protected: Heap::Base *allocData(std::size_t size); Heap::Object *allocObjectWithMemberData(const QV4::VTable *vtable, uint nMembers); -#ifdef DETAILED_MM_STATS - void willAllocate(std::size_t size); -#endif // DETAILED_MM_STATS - private: void collectFromJSStack(MarkStack *markStack) const; void mark(); @@ -481,6 +466,14 @@ public: bool gcBlocked = false; bool aggressiveGC = false; bool gcStats = false; + bool gcCollectorStats = false; + + struct { + size_t maxReservedMem = 0; + size_t maxAllocatedMem = 0; + size_t maxUsedMem = 0; + uint allocations[BlockAllocator::NumBins]; + } statistics; }; } |