This wiki article contains incomplete and informal notes about the MPS, the precursor to more formal documentation. Not confidential. Readership: MPS users and developers.

Scope of terms

Terms are marked as being applicable in the following scopes:

(general)
term in general use in the memory-management community; see The Memory Management Glossary.
(mps.h)
term used in the published MPS interface or published documentation, for client programs to use
(internal)
term used in internal MPS code or design documentation (not for use in client programs)

Note: often an mps.h term has a related (but not exactly corresponding) internal term. The distinction can be critical.

Terms

Pools getting raw memory from the Arena

This memory will be used for client objects. There are two interfaces: a high-level "segment" interface, and a simpler "arena memory" interface.

segment (internal)

= a contiguous piece of memory of arbitrary size, with associated properties for participating in garbage collection (see SegStruct).

A pool may call SegAlloc() to request a segment from the arena. The segment is the unit of pool-to-pool and pool-to-MPM interaction for GC.

Design: design/seg.

Interface: SegAlloc() et al in mpm.h.

Historical note: before 'sunset on segments' (1999-11-18, change 21000) a segment was a VM page.

arena memory (internal)

= a contiguous piece of memory of arbitrary size, returned by ArenaAlloc()

A pool may call ArenaAlloc() to request raw memory from the arena. This is a simpler interface than segments, suitable for simple pools that do not participate in garbage collection, pools used internally by the MPM, etc.

(Note: this ArenaAlloc() interface is sometimes called the "tract" interface).

Pools getting memory for administrative use

This memory will be used for the pool's administrative datastructures, such as allocation tables.

control memory (internal)

Pools use ControlAlloc() and ControlFree() to obtain or free control memory.

How the arena handles memory

See tract.c.

chunk (internal)

= a contiguous (I think) piece of address space that has been reserved (I think) by the arena

arena->primary points to the arena's first chunk

page (internal)
= unit of granularity of arena allocation; object corresponding to one operating-system VM page
tract (internal)
= a page that is allocated to a pool

Other terms:

Attr (internal)
A bitset of pool or pool class attributes. See design/type/#attr.
Ring (internal)
A Parent node, linked to zero or more Child nodes. Used throughout MPS internals. See design/ring. The RING_FOR macro visits all Child nodes. Note: when a node (RingStruct) appears in a larger structure, there is (alas) no indication whether it is the parent node, or a child node.

B. Document History

  2006-06-06  RHSK  Created.
  2006-06-21  RHSK  Scope of terms; client/mutator, ap/buffer.
  2006-07-03  RHSK  Ring.
  2006-08-02  RHSK  Foreign code.  Format (clarify).
  2006-08-14  RHSK  Pieces of memory: chunk, segment, tract, page
  2012-10-18  GDR   Removed external terms (now in MPS glossary proper)

C. Copyright and License

This document is copyright © 2006 Ravenbrook Limited. All rights reserved. This is an open source license. Contact Ravenbrook for commercial licensing options.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Redistributions in any form must be accompanied by information on how to obtain complete source code for the this software and any accompanying software that uses this software. The source code must either be included in the distribution or be available for no more than the cost of distribution plus a nominal fee, and must be freely redistributable under reasonable conditions. For an executable file, complete source code means the source code for all modules it contains. It does not include source code for modules or files that typically accompany the major components of the operating system on which the executable file runs.

This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement, are disclaimed. In no event shall the copyright holders and contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.