MFS pool class

author Richard Brooksby
date 1996-11-07
index terms pair: MFS pool class; design single: pool class; MFS design
revision //info.ravenbrook.com/project/mps/master/design/poolmfs.txt#9
status Incomplete design
tag design.mps.poolmfs

Overview

MFS stands for "Manual Fixed Small". The MFS pool class manages objects that are of a fixed size. It is intended to only manage small objects efficiently. Storage is recycled manually by the client programmer.

A particular instance of an MFS Pool can manage objects only of a single size, but different instances can manage objects of different sizes. The size of object that an instance can manage is declared when the instance is created.

Implementation

.impl.extents: MFS operates in a very simple manner: each extent allocated from the arena is divided into units.

.impl.free-units: Free units are kept on a linked list using a header stored in the unit itself. The linked list is not ordered; allocation and deallocation simply pop and push from the head of the list. This is fast, but successive allocations might have poor locality if previous successive frees did.

.impl.extent-ring: The list of extents belonging to the pool is maintained as a ring with a node at the start of each extent.

.impl.extent-ring.justify: Storing the linked list of free nodes and the extent ring node in the managed memory is against the general principle of the MPS design, which keeps its management structures away from client memory. However, the MFS pool is used during the bootstrapping process (see design.mps.bootstrap.land.sol.pool) and so has no other memory pools available for storage.

Document History

  • 1996-11-07 RB Incomplete design.
  • 2002-06-07 RB Converted from MMInfo database design document.
  • 2013-05-23 GDR Converted to reStructuredText.
  • 2016-03-18 RB Moved design text from leader comment of poolmfs.c. Explained chaining of extents using an embedded ring node.