5. AMCZ (Automatic Mostly-Copying Zero-rank)

AMCZ is a general-purpose automatically managed pool class for leaf objects (“zero-rank” objects that contain no references).

It is otherwise identical to AMC (Automatic Mostly-Copying).

AMCZ is intended for “simple” objects like numbers, characters, and strings. Segregating these objects into one or more AMCZ pools avoids the cost of scanning them that would be incurred if they were interleaved in a pool with objects containing references. It may also simplify the scanning of the objects that are left behind.

See Segregation of objects for an example.

5.1. AMCZ properties

AMCZ is identical to AMC (Automatic Mostly-Copying), except that:

5.2. AMCZ interface

#include "mpscamc.h"
mps_pool_class_t mps_class_amcz(void)

Return the pool class for an AMCZ (Automatic Mostly-Copying Zero-rank) pool.

When creating an AMCZ pool, mps_pool_create_k() requires one keyword argument:

It accepts two optional keyword arguments:

For example:

    MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
    res = mps_pool_create_k(&pool, arena, mps_class_amcz(), args);
} MPS_ARGS_END(args);

5.3. AMCZ introspection

See AMC introspection.