Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qv4mm_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:critical reason:low-level-memory-management
4
5#ifndef QV4GC_H
6#define QV4GC_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <private/qv4global_p.h>
20#include <private/qv4value_p.h>
21#include <private/qv4scopedvalue_p.h>
22#include <private/qv4object_p.h>
23#include <private/qv4mmdefs_p.h>
24#include <QList>
25
26#include <variant>
27#include <vector>
28
29#define MM_DEBUG 0
30
31QT_BEGIN_NAMESPACE
32
33namespace QV4 {
34
35// Iterate a potentially growing container without querying the size on each iteration.
36// Return the first index where p doesn't hold, or the end of the container.
37template<typename Container, typename UnaryPred>
38typename Container::size_type reiterate(
39 Container &container, typename Container::size_type first, UnaryPred &&p)
40{
41 auto last = container.size();
42 while (first < last) {
43 do {
44 if (!p(first))
45 return first;
46 } while (++first < last);
47
48 Q_ASSERT(first == last);
49
50 // Re-fetch the container size.
51 // If the container hasn't grown, we're done since last == first, still.
52 // Otherwise, do one more round via the "while (first < last)" above.
53 last = container.size();
54 }
55
56 // Returning last here allows input of an out of range first, saving us
57 // one size check ahead of running this.
58 return last;
59}
60
61// index based version of partition to handle potential growth at the end
62template<typename Container, class UnaryPred>
63typename Container::size_type partition(Container &container, UnaryPred &&p)
64{
65 // Figure out the first entry where p doesn't hold.
66 auto first = reiterate(container, 0, p);
67
68 // Iterate the remaining entries and swap any entry where p holds
69 // to the (moving) end of the front section of the container.
70 // Any time we do that, the front section grows by 1. Therefore, the back
71 // section can only contain entries where p doesn't hold in the end.
72 reiterate(container, first + 1, [&p, &container, &first](const auto i) {
73 if (p(i)) {
74 // It's important to re-resolve container.at(i) for the std::swap.
75 // The container may have grown as result of determining p, thereby
76 // invalidating any reference to an entry taken before.
77 std::swap(container.at(i), container.at(first++));
78 }
79 return true;
80 });
81
82 return first;
83}
84
85struct GCData { virtual ~GCData(){};};
86
90
91// The QObjectWrappers that InitCallDestroyObjects has determined to be unreachable, and that
92// CallDestroyObjects destroys, whatever happens in between.
95 std::size_t next = 0; // Index into wrappers to resume destructions from on the next slice
96};
97
99 Q_GADGET_EXPORT(Q_QML_EXPORT)
100
101public:
102 enum GCState {
113 // The following needs to be after InitCallDestroyObjects,
114 // even if it normally would run before it, to ensure that in
115 // a normal incremental run the stack is redrained before this
116 // is run as we make use of that knowledge in a test.
125 };
126 Q_ENUM(GCState)
127
132
133 struct GCStateInfo {
135 GCState (*execute)(GCStateMachine *, ExtraData &) = nullptr; // Function to execute for this state, returns true if ready to transition
136 bool breakAfter{false};
137 };
138
145 MemoryManager *mm = nullptr;
146 ExtraData stateData; // extra date for specific states
147 bool collectTimings = false;
148 #ifdef QT_BUILD_INTERNAL
149 // This is used only to simplify testing.
151 std::vector<BitmapError> *bitmapErrors = nullptr;
152 #endif
153
155
156 inline void step() {
157 if (!inProgress()) {
158 reset();
159 }
160 transition();
161 }
162
163 inline bool inProgress() {
164 return state != GCState::Invalid;
165 }
166
167 inline void reset() {
168 state = GCState::MarkStart;
169 }
170
171 Q_QML_EXPORT void transition();
172
173 inline void handleTimeout(GCState state) {
174 Q_UNUSED(state);
175 }
176};
177
180
181struct ChunkAllocator;
182struct MemorySegment;
183
185 BlockAllocator(ChunkAllocator *chunkAllocator, ExecutionEngine *engine)
186 : chunkAllocator(chunkAllocator), engine(engine)
187 {
188 memset(freeBins, 0, sizeof(freeBins));
189 }
190
191 enum { NumBins = 8 };
192
193 static inline size_t binForSlots(size_t nSlots) {
194 return nSlots >= NumBins ? NumBins - 1 : nSlots;
195 }
196
197 HeapItem *allocate(size_t size, bool forceAllocation = false);
198
200 return Chunk::AvailableSlots*chunks.size();
201 }
202
204 return chunks.size()*Chunk::DataSize;
205 }
206 size_t usedMem() const {
207 uint used = 0;
208 for (auto c : chunks)
209 used += c->nUsedSlots()*Chunk::SlotSize;
210 return used;
211 }
212
213 void sweep();
214 void freeAll();
215 void resetBlackBits();
216
217 // bump allocations
218 HeapItem *nextFree = nullptr;
223 ExecutionEngine *engine;
225 uint *allocationStats = nullptr;
226};
227
229 HugeItemAllocator(ChunkAllocator *chunkAllocator, ExecutionEngine *engine)
230 : chunkAllocator(chunkAllocator), engine(engine)
231 {}
232
233 HeapItem *allocate(size_t size);
234 void sweep();
235 void freeAll();
236 void resetBlackBits();
237
238 size_t usedMem() const {
239 size_t used = 0;
240 for (const auto &c : chunks)
241 used += c.size;
242 return used;
243 }
244
246 ExecutionEngine *engine;
252
254};
255
256
257class Q_QML_EXPORT MemoryManager
258{
260
261public:
263 ~MemoryManager();
264
265 template <typename ToBeMarked>
266 friend struct GCCriticalSection;
267
268 // TODO: this is only for 64bit (and x86 with SSE/AVX), so exend it for other architectures to be slightly more efficient (meaning, align on 8-byte boundaries).
269 // Note: all occurrences of "16" in alloc/dealloc are also due to the alignment.
270 constexpr static inline std::size_t align(std::size_t size)
271 { return (size + Chunk::SlotSize - 1) & ~(Chunk::SlotSize - 1); }
272
273 /* NOTE: allocManaged comes in various overloads. If size is not passed explicitly
274 sizeof(ManagedType::Data) is used for size. However, there are quite a few cases
275 where we allocate more than sizeof(ManagedType::Data); that's generally the case
276 when the Object has a ValueArray member.
277 If no internal class pointer is provided, ManagedType::defaultInternalClass(engine)
278 will be used as the internal class.
279 */
280
281 template<typename ManagedType>
282 inline typename ManagedType::Data *allocManaged(std::size_t size, Heap::InternalClass *ic)
283 {
284 static_assert(std::is_trivially_copyable_v<typename ManagedType::Data>);
285 static_assert(std::is_trivially_default_constructible_v<typename ManagedType::Data>);
286 size = align(size);
287 typename ManagedType::Data *d = static_cast<typename ManagedType::Data *>(allocData(size));
288 d->internalClass.set(engine, ic);
289 Q_ASSERT(d->internalClass && d->internalClass->vtable);
290 Q_ASSERT(ic->vtable == ManagedType::staticVTable());
291 return d;
292 }
293
294 template<typename ManagedType>
295 inline typename ManagedType::Data *allocManaged(Heap::InternalClass *ic)
296 {
297 return allocManaged<ManagedType>(sizeof(typename ManagedType::Data), ic);
298 }
299
300 template<typename ManagedType>
301 inline typename ManagedType::Data *allocManaged(std::size_t size, InternalClass *ic)
302 {
303 return allocManaged<ManagedType>(size, ic->d());
304 }
305
306 template<typename ManagedType>
307 inline typename ManagedType::Data *allocManaged(InternalClass *ic)
308 {
309 return allocManaged<ManagedType>(sizeof(typename ManagedType::Data), ic);
310 }
311
312 template<typename ManagedType>
313 inline typename ManagedType::Data *allocManaged(std::size_t size)
314 {
315 Scope scope(engine);
316 Scoped<InternalClass> ic(scope, ManagedType::defaultInternalClass(engine));
317 return allocManaged<ManagedType>(size, ic);
318 }
319
320 template<typename ManagedType>
321 inline typename ManagedType::Data *allocManaged()
322 {
323 auto constexpr size = sizeof(typename ManagedType::Data);
324 Scope scope(engine);
325 Scoped<InternalClass> ic(scope, ManagedType::defaultInternalClass(engine));
326 return allocManaged<ManagedType>(size, ic);
327 }
328
329 template <typename ObjectType>
330 typename ObjectType::Data *allocateObject(Heap::InternalClass *ic)
331 {
332 Heap::Object *o = allocObjectWithMemberData(ObjectType::staticVTable(), ic->size);
333 o->internalClass.set(engine, ic);
334 Q_ASSERT(o->internalClass.get() && o->vtable());
335 Q_ASSERT(o->vtable() == ObjectType::staticVTable());
336 return static_cast<typename ObjectType::Data *>(o);
337 }
338
339 template <typename ObjectType>
340 typename ObjectType::Data *allocateObject(InternalClass *ic)
341 {
342 return allocateObject<ObjectType>(ic->d());
343 }
344
345 template <typename ObjectType>
346 typename ObjectType::Data *allocateObject()
347 {
348 Scope scope(engine);
349 Scoped<InternalClass> ic(scope, ObjectType::defaultInternalClass(engine));
350 ic = ic->changeVTable(ObjectType::staticVTable());
351 ic = ic->changePrototype(ObjectType::defaultPrototype(engine)->d());
352 return allocateObject<ObjectType>(ic);
353 }
354
355 template <typename ManagedType, typename Arg1>
356 typename ManagedType::Data *allocWithStringData(std::size_t unmanagedSize, Arg1 &&arg1)
357 {
358 typename ManagedType::Data *o = reinterpret_cast<typename ManagedType::Data *>(allocString(unmanagedSize));
359 o->internalClass.set(engine, ManagedType::defaultInternalClass(engine));
360 Q_ASSERT(o->internalClass && o->internalClass->vtable);
361 o->init(std::forward<Arg1>(arg1));
362 return o;
363 }
364
365 template <typename ObjectType, typename... Args>
366 typename ObjectType::Data *allocObject(Heap::InternalClass *ic, Args&&... args)
367 {
368 typename ObjectType::Data *d = allocateObject<ObjectType>(ic);
369 d->init(std::forward<Args>(args)...);
370 return d;
371 }
372
373 template <typename ObjectType, typename... Args>
374 typename ObjectType::Data *allocObject(InternalClass *ic, Args&&... args)
375 {
376 typename ObjectType::Data *d = allocateObject<ObjectType>(ic);
377 d->init(std::forward<Args>(args)...);
378 return d;
379 }
380
381 template <typename ObjectType, typename... Args>
382 typename ObjectType::Data *allocate(Args&&... args)
383 {
384 Scope scope(engine);
385 Scoped<ObjectType> t(scope, allocateObject<ObjectType>());
386 t->d()->init(std::forward<Args>(args)...);
387 return t->d();
388 }
389
390 template <typename ManagedType, typename... Args>
391 typename ManagedType::Data *alloc(Args&&... args)
392 {
393 Scope scope(engine);
394 Scoped<ManagedType> t(scope, allocManaged<ManagedType>());
395 t->d()->init(std::forward<Args>(args)...);
396 return t->d();
397 }
398
399 void runGC();
401 void runFullGC();
402
403 void dumpStats() const;
404
406 size_t getAllocatedMem() const;
407 size_t getLargeItemsMem() const;
408
409 // called when a JS object grows itself. Specifically: Heap::String::append
410 // and InternalClassDataPrivate<PropertyAttributes>.
411 void changeUnmanagedHeapSizeUsage(qptrdiff delta) { unmanagedHeapSize += delta; }
412
413 // called at the end of a gc cycle
415
416 template<typename ManagedType>
417 typename ManagedType::Data *allocIC()
418 {
419 Heap::Base *b = *allocate(&icAllocator, align(sizeof(typename ManagedType::Data)));
420 return static_cast<typename ManagedType::Data *>(b);
421 }
422
423 void registerWeakMap(Heap::MapObject *map);
424 void registerWeakSet(Heap::SetObject *set);
425
426 void onEventLoop();
427
428 //GC related methods
429 void setGCTimeLimit(int timeMs);
430 MarkStack* markStack() { return m_markStack.get(); }
431
433 std::vector<QQmlRefPointer<CompiledData::CompilationUnit>> &&units);
434
435protected:
436 /// expects size to be aligned
438 Heap::Base *allocData(std::size_t size);
439 Heap::Object *allocObjectWithMemberData(const QV4::VTable *vtable, uint nMembers);
440
441private:
442 enum {
443 MinUnmanagedHeapSizeGCLimit = 128 * 1024
444 };
445
446public:
450 {
451 const bool incrementalGCIsAlreadyRunning = m_markStack != nullptr;
452 const bool aboveUnmanagedHeapLimit = incrementalGCIsAlreadyRunning
453 ? unmanagedHeapSize > 3 * unmanagedHeapSizeGCLimit / 2
454 : unmanagedHeapSize > unmanagedHeapSizeGCLimit;
455 return aboveUnmanagedHeapLimit;
456 }
457private:
458 void lastSweep();
459 bool shouldRunGC() const;
460
461 HeapItem *allocate(BlockAllocator *allocator, std::size_t size)
462 {
463 const bool incrementalGCIsAlreadyRunning = m_markStack != nullptr;
464
465 bool didGCRun = false;
466 if (aggressiveGC) {
468 didGCRun = true;
469 }
470
472 if (!didGCRun)
473 incrementalGCIsAlreadyRunning ? (void) tryForceGCCompletion() : runGC();
474 didGCRun = true;
475 }
476
477 if (size > Chunk::DataSize)
478 return hugeItemAllocator.allocate(size);
479
480 if (HeapItem *m = allocator->allocate(size))
481 return m;
482
483 if (!didGCRun && shouldRunGC())
484 runGC();
485
486 return allocator->allocate(size, true);
487 }
488
489public:
494
495 QV4::ExecutionEngine *engine;
500 PersistentValueStorage *m_persistentValues;
501 PersistentValueStorage *m_weakValues;
505
508
509 // For recording objects from compilation units during GC
511
512 std::size_t unmanagedHeapSize = 0; // the amount of bytes of heap that is not managed by the memory manager, but which is held onto by managed items.
515
518 bool aggressiveGC = false;
520
521#if defined(MM_STATS) || !defined(QT_NO_DEBUG)
524#endif
525
532
534 {
541
542 void start(MemoryManager *mm);
543 void step(MemoryManager *mm);
544 void end(MemoryManager *mm);
545 };
546
549};
550
551/*!
552 \internal
553 GCCriticalSection prevets the gc from running, until it is destructed.
554 In its dtor, it runs a check whether we've reached the unmanaegd heap limit,
555 and triggers a gc run if necessary.
556 Lastly, it can optionally mark an object passed to it before runnig the gc.
557 */
558template <typename ToBeMarked = void>
561
569 {
572 if constexpr (!std::is_same_v<ToBeMarked, void>) {
573 if (m_toBeMarked) {
574 // The gc was running when we entered the critical section, and blocking it
575 // cannot have finished it, so its mark stack must still be alive.
579 }
580 }
581 }
582 // if we were already in a critical section before, that one ought to take care of
583 // completing the gc run, and we don't have anything to do.
585 return;
586 /* Otherwise, because we blocked the gc, we might be using too much memoryon the unmanaged heap
587 and did not run the normal fixup logic. So recheck again, and trigger a gc run
588 if necessary. But never start one while the engine is shutting down: the final
589 sweep in ~MemoryManager runs destruction handlers that may open a critical
590 section, and re-entering the collector then would mark through already-freed
591 engine state (such as the identifier table). */
593 return;
594 if (!m_engine->isGCOngoing) {
596 } else {
599 }
600 }
601
602private:
604 MemoryManager::Blockness m_oldState;
605 ToBeMarked *m_toBeMarked;
606};
607
608}
609
610QT_END_NAMESPACE
611
612#endif // QV4GC_H
ManagedType::Data * allocManaged(InternalClass *ic)
Definition qv4mm_p.h:307
std::unique_ptr< CollectorStatistics > collectorStatistics
Definition qv4mm_p.h:548
bool isAboveUnmanagedHeapLimit()
Definition qv4mm_p.h:449
friend struct GCCriticalSection
Definition qv4mm_p.h:266
Heap::SetObject * weakSets
Definition qv4mm_p.h:504
QV4::ExecutionEngine * engine
Definition qv4mm_p.h:495
bool crossValidateIncrementalGC
Definition qv4mm_p.h:519
ObjectType::Data * allocateObject(Heap::InternalClass *ic)
Definition qv4mm_p.h:330
size_t getRegularItemsMem() const
Definition qv4mm.cpp:1447
Heap::Object * allocObjectWithMemberData(const QV4::VTable *vtable, uint nMembers)
Definition qv4mm.cpp:1156
size_t getLargeItemsMem() const
Definition qv4mm.cpp:1457
std::vector< QObject * > findObjectsForCompilationUnits(std::vector< QQmlRefPointer< CompiledData::CompilationUnit > > &&units)
Definition qv4mm.cpp:1687
ManagedType::Data * allocManaged()
Definition qv4mm_p.h:321
bool tryForceGCCompletion()
Definition qv4mm.cpp:1381
ManagedType::Data * allocManaged(std::size_t size, Heap::InternalClass *ic)
Definition qv4mm_p.h:282
ManagedType::Data * allocManaged(std::size_t size, InternalClass *ic)
Definition qv4mm_p.h:301
size_t lastAllocRequestedSlots
Definition qv4mm_p.h:523
void changeUnmanagedHeapSizeUsage(qptrdiff delta)
Definition qv4mm_p.h:411
QList< Value * > m_pendingFreedObjectWrapperValue
Definition qv4mm_p.h:502
std::unique_ptr< GCStateMachine > gcStateMachine
Definition qv4mm_p.h:506
ObjectType::Data * allocate(Args &&... args)
Definition qv4mm_p.h:382
Blockness gcBlocked
Definition qv4mm_p.h:517
ChunkAllocator * chunkAllocator
Definition qv4mm_p.h:496
PersistentValueStorage * m_persistentValues
Definition qv4mm_p.h:500
ManagedType::Data * allocWithStringData(std::size_t unmanagedSize, Arg1 &&arg1)
Definition qv4mm_p.h:356
void cleanupDeletedQObjectWrappersInSweep()
Definition qv4mm.cpp:1299
PersistentValueStorage * m_weakValues
Definition qv4mm_p.h:501
std::size_t unmanagedHeapSize
Definition qv4mm_p.h:512
ManagedType::Data * allocManaged(std::size_t size)
Definition qv4mm_p.h:313
std::unique_ptr< Statistics > statistics
Definition qv4mm_p.h:547
void registerWeakMap(Heap::MapObject *map)
Definition qv4mm.cpp:1485
ManagedType::Data * allocManaged(Heap::InternalClass *ic)
Definition qv4mm_p.h:295
void dumpStats() const
Definition qv4mm.cpp:1533
std::size_t usedSlotsAfterLastFullSweep
Definition qv4mm_p.h:514
BlockAllocator blockAllocator
Definition qv4mm_p.h:497
HugeItemAllocator hugeItemAllocator
Definition qv4mm_p.h:499
std::unique_ptr< MarkStack > m_markStack
Definition qv4mm_p.h:507
Heap::Base * allocData(std::size_t size)
Definition qv4mm.cpp:1141
size_t getAllocatedMem() const
Definition qv4mm.cpp:1452
ManagedType::Data * allocIC()
Definition qv4mm_p.h:417
void setGCTimeLimit(int timeMs)
Definition qv4mm.cpp:1260
ObjectType::Data * allocateObject()
Definition qv4mm_p.h:346
void registerWeakSet(Heap::SetObject *set)
Definition qv4mm.cpp:1491
ObjectType::Data * allocObject(InternalClass *ic, Args &&... args)
Definition qv4mm_p.h:374
Heap::MapObject * weakMaps
Definition qv4mm_p.h:503
void updateUnmanagedHeapSizeGCLimit()
Definition qv4mm.cpp:1462
ManagedType::Data * alloc(Args &&... args)
Definition qv4mm_p.h:391
ObjectType::Data * allocObject(Heap::InternalClass *ic, Args &&... args)
Definition qv4mm_p.h:366
ObjectsForCompilationUnit * m_recordedObjects
Definition qv4mm_p.h:510
std::size_t unmanagedHeapSizeGCLimit
Definition qv4mm_p.h:513
static constexpr std::size_t align(std::size_t size)
Definition qv4mm_p.h:270
ObjectType::Data * allocateObject(InternalClass *ic)
Definition qv4mm_p.h:340
MarkStack * markStack()
Definition qv4mm_p.h:430
BlockAllocator icAllocator
Definition qv4mm_p.h:498
Combined button and popup list for selecting options.
static void updateProtoUsage(Heap::Object *o, Heap::InternalClass *ic)
static Heap::InternalClass * cleanInternalClass(Heap::InternalClass *orig)
static PropertyAttributes attributesFromFlags(int flags)
static void addDummyEntry(InternalClass *newClass, PropertyHash::Entry e)
Definition qjsvalue.h:24
GCStateMachine::GCStateInfo GCStateInfo
Definition qv4mm_p.h:179
Container::size_type partition(Container &container, UnaryPred &&p)
Definition qv4mm_p.h:63
Container::size_type reiterate(Container &container, typename Container::size_type first, UnaryPred &&p)
Definition qv4mm_p.h:38
ChunkAllocator * chunkAllocator
Definition qv4mm_p.h:222
size_t usedMem() const
Definition qv4mm_p.h:206
HeapItem * freeBins[NumBins]
Definition qv4mm_p.h:221
uint * allocationStats
Definition qv4mm_p.h:225
size_t usedSlotsAfterLastSweep
Definition qv4mm_p.h:220
std::vector< Chunk * > chunks
Definition qv4mm_p.h:224
BlockAllocator(ChunkAllocator *chunkAllocator, ExecutionEngine *engine)
Definition qv4mm_p.h:185
void resetBlackBits()
Definition qv4mm.cpp:563
HeapItem * allocate(size_t size, bool forceAllocation=false)
Definition qv4mm.cpp:419
size_t totalSlots() const
Definition qv4mm_p.h:199
static size_t binForSlots(size_t nSlots)
Definition qv4mm_p.h:193
HeapItem * nextFree
Definition qv4mm_p.h:218
size_t allocatedMem() const
Definition qv4mm_p.h:203
ExecutionEngine * engine
Definition qv4mm_p.h:223
virtual ~GCData()
Definition qv4mm_p.h:85
std::vector< Heap::QObjectWrapper * > wrappers
Definition qv4mm_p.h:94
PersistentValueStorage::Iterator it
Definition qv4mm_p.h:88
std::variant< std::monostate, GCIteratorStorage, GCDestroyListStorage > ExtraData
Definition qv4mm_p.h:134
GCState(*) execute(GCStateMachine *, ExtraData &)
Definition qv4mm_p.h:135
Q_QML_EXPORT void transition()
Definition qv4mm.cpp:1652
std::chrono::microseconds timeLimit
Definition qv4mm_p.h:141
MemoryManager * mm
Definition qv4mm_p.h:145
void handleTimeout(GCState state)
Definition qv4mm_p.h:173
ExtraData stateData
Definition qv4mm_p.h:146
std::array< StepTiming, GCState::Count > executionTiming
Definition qv4mm_p.h:144
std::array< GCStateInfo, GCState::Count > stateInfoMap
Definition qv4mm_p.h:143
GCStateInfo::ExtraData ExtraData
Definition qv4mm_p.h:139
QDeadlineTimer deadline
Definition qv4mm_p.h:142
void init(InternalClass *other)
void init(ExecutionEngine *engine)
InternalClassTransition Transition
InternalClassTransition & lookupOrInsertTransition(const InternalClassTransition &t)
static void markObjects(Heap::Base *ic, MarkStack *stack)
static void removeMember(QV4::Object *object, PropertyKey identifier)
PropertyHash::Entry * findEntry(const PropertyKey id)
ExecutionEngine * engine
Definition qv4mm_p.h:246
std::vector< HugeChunk > chunks
Definition qv4mm_p.h:253
HugeItemAllocator(ChunkAllocator *chunkAllocator, ExecutionEngine *engine)
Definition qv4mm_p.h:229
ChunkAllocator * chunkAllocator
Definition qv4mm_p.h:245
size_t usedMem() const
Definition qv4mm_p.h:238
HeapItem * allocate(size_t size)
Definition qv4mm.cpp:569
void start(MemoryManager *mm)
Definition qv4mm.cpp:1700
uint allocations[BlockAllocator::NumBins]
Definition qv4mm_p.h:530
PropertyHash::Entry * entries
void addEntry(const Entry &entry, int classSize)
PropertyHash(const PropertyHash &other)
PropertyHashData * d
void detach(bool grow, int classSize)
bool isStringOrSymbol() const
bool isArrayIndex() const
uint asArrayIndex() const
static PropertyKey invalid()
Scope(ExecutionEngine *e)
SharedInternalClassDataPrivate(const SharedInternalClassDataPrivate &other, uint pos, PropertyKey value)
SharedInternalClassDataPrivate(const SharedInternalClassDataPrivate &other)