Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QFreeListDefaultConstants Struct Reference

#include <qfreelist_p.h>

+ Inheritance diagram for QFreeListDefaultConstants:
+ Collaboration diagram for QFreeListDefaultConstants:

Public Types

enum  {
  InitialNextValue = 0 , IndexMask = 0x00ffffff , SerialMask = ~IndexMask & ~0x80000000 , SerialCounter = IndexMask + 1 ,
  MaxIndex = IndexMask , BlockCount = 4
}
 

Static Public Attributes

static const int Sizes [BlockCount]
 

Detailed Description

Defines default constants used by QFreeList:

  • The initial value returned by QFreeList::next() is zero.
  • QFreeList allows for up to 16777216 elements in QFreeList and uses the top 8 bits to store a serial counter for ABA protection.
  • QFreeList will make a maximum of 4 allocations (blocks), with each successive block larger than the previous.
  • Sizes static int[] array to define the size of each block.

It is possible to define your own constants struct/class and give this to QFreeList to customize/tune the behavior.

Definition at line 78 of file qfreelist_p.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
InitialNextValue 
IndexMask 
SerialMask 
SerialCounter 
MaxIndex 
BlockCount 

Definition at line 81 of file qfreelist_p.h.

Member Data Documentation

◆ Sizes


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