Sign in Join
FPDoc Onlineexperiment

TNonFreePooledMemManager class

In unit PooledMM

Memory manager for fixed memory blocks which does not free any memory.

Declaration

pascal
TNonFreePooledMemManager = class

Description

TNonFreePooledMemManager keeps a list of fixed-size memory blocks in memory. Each block has the same size, making it suitable for storing a lot of records of the same type. It does not free the items stored in it, except when the list is cleared as a whole.

It allocates memory for the blocks in a exponential way, i.e. each time a new block of memory must be allocated, it's size is the double of the last block. The first block will contain 8 items.

Properties

ItemSizepublicSize of an item in the list.

Methods

ClearpublicClears the memory.
CreatepublicCreates a new instance of TNonFreePooledMemManager.
DestroypublicRemoves the TNonFreePooledMemManager instance from memory.
NewItempublicReturn a pointer to a new memory block.
EnumerateItemspublicEnumerate all items in the list.

Fields

ClearOnCreatepublicDetermines whether newly allocated memory should be cleared.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.