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
QV4::BlockAllocator Struct Reference

#include <qv4mm_p.h>

Collaboration diagram for QV4::BlockAllocator:

Public Types

enum  { NumBins = 8 }

Public Member Functions

 BlockAllocator (ChunkAllocator *chunkAllocator, ExecutionEngine *engine)
HeapItemallocate (size_t size, bool forceAllocation=false)
size_t totalSlots () const
size_t allocatedMem () const
size_t usedMem () const
void sweep ()
void freeAll ()
void resetBlackBits ()

Static Public Member Functions

static size_t binForSlots (size_t nSlots)

Public Attributes

HeapItemnextFree = nullptr
size_t nFree = 0
size_t usedSlotsAfterLastSweep = 0
HeapItemfreeBins [NumBins]
ChunkAllocatorchunkAllocator
ExecutionEngineengine
std::vector< Chunk * > chunks
uintallocationStats = nullptr

Detailed Description

Definition at line 123 of file qv4mm_p.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
NumBins 

Definition at line 130 of file qv4mm_p.h.

Constructor & Destructor Documentation

◆ BlockAllocator()

QV4::BlockAllocator::BlockAllocator ( ChunkAllocator * chunkAllocator,
ExecutionEngine * engine )
inline

Definition at line 124 of file qv4mm_p.h.

References chunkAllocator, and engine.

Member Function Documentation

◆ allocate()

HeapItem * QV4::BlockAllocator::allocate ( size_t size,
bool forceAllocation = false )

Definition at line 426 of file qv4mm.cpp.

◆ allocatedMem()

size_t QV4::BlockAllocator::allocatedMem ( ) const
inline

Definition at line 142 of file qv4mm_p.h.

◆ binForSlots()

size_t QV4::BlockAllocator::binForSlots ( size_t nSlots)
inlinestatic

Definition at line 132 of file qv4mm_p.h.

References NumBins.

◆ freeAll()

void QV4::BlockAllocator::freeAll ( )

Definition at line 559 of file qv4mm.cpp.

◆ resetBlackBits()

void QV4::BlockAllocator::resetBlackBits ( )

Definition at line 569 of file qv4mm.cpp.

◆ sweep()

void QV4::BlockAllocator::sweep ( )

Definition at line 532 of file qv4mm.cpp.

◆ totalSlots()

size_t QV4::BlockAllocator::totalSlots ( ) const
inline

Definition at line 138 of file qv4mm_p.h.

◆ usedMem()

size_t QV4::BlockAllocator::usedMem ( ) const
inline

Definition at line 145 of file qv4mm_p.h.

Member Data Documentation

◆ allocationStats

uint* QV4::BlockAllocator::allocationStats = nullptr

Definition at line 164 of file qv4mm_p.h.

◆ chunkAllocator

ChunkAllocator* QV4::BlockAllocator::chunkAllocator

Definition at line 161 of file qv4mm_p.h.

Referenced by BlockAllocator().

◆ chunks

std::vector<Chunk *> QV4::BlockAllocator::chunks

Definition at line 163 of file qv4mm_p.h.

◆ engine

ExecutionEngine* QV4::BlockAllocator::engine

Definition at line 162 of file qv4mm_p.h.

Referenced by BlockAllocator().

◆ freeBins

HeapItem* QV4::BlockAllocator::freeBins[NumBins]

Definition at line 160 of file qv4mm_p.h.

◆ nextFree

HeapItem* QV4::BlockAllocator::nextFree = nullptr

Definition at line 157 of file qv4mm_p.h.

◆ nFree

size_t QV4::BlockAllocator::nFree = 0

Definition at line 158 of file qv4mm_p.h.

◆ usedSlotsAfterLastSweep

size_t QV4::BlockAllocator::usedSlotsAfterLastSweep = 0

Definition at line 159 of file qv4mm_p.h.


The documentation for this struct was generated from the following files: