13. SNC (Stack No Checking)

Deprecated

starting with version 1.111.

If you need special handling of stack-like allocation, contact us.

SNC is a manually managed pool class that supports a stack-like protocol for allocation and deallocation using allocation frames on allocation points. See Allocation frames.

If mps_ap_frame_pop() is used on an allocation point in an SNC pool (after a corresponding call to mps_ap_frame_push()), then the objects affected by the pop are effectively declared dead, and may be reclaimed by the collector. Extant references to such objects from reachable or de facto alive objects are safe, but such other objects should be dead; that is, such references must never be used.

13.1. SNC properties

13.2. SNC introspection

#include "mpscsnc.h"
mps_class_t mps_class_snc(void)

Return the pool class for an SNC (Stack No Check) pool.

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

For example:

MPS_ARGS_BEGIN(args) {
    MPS_ARGS_ADD(args, MPS_KEY_FORMAT, fmt);
    MPS_ARGS_DONE(args);
    res = mps_pool_create_k(&pool, arena, mps_class_snc(), args);
} MPS_ARGS_END(args);

Deprecated

starting with version 1.112.

When using mps_pool_create(), pass the format like this:

mps_res_t mps_pool_create(mps_pool_t *pool_o, mps_arena_t arena,
                          mps_class_t mps_class_snc(),
                          mps_fmt_t fmt)

When creating an allocation point on an SNC pool, mps_ap_create_k() requires one keyword argument:

For example:

MPS_ARGS_BEGIN(args) {
    MPS_ARGS_ADD(args, MPS_KEY_RANK, mps_rank_exact());
    MPS_ARGS_DONE(args);
    res = mps_ap_create_k(&ap, awl_pool, args);
} MPS_ARGS_END(args);

Deprecated

starting with version 1.112.

When using mps_ap_create(), pass the rank like this:

mps_res_t mps_ap_create(mps_ap_t *ap_o, mps_pool_t pool,
                        mps_rank_t rank)