YAP 7.1.0
Term Handles

Also known as term handles, slots are offsets to entries in the local stack.

Also known as term handles, slots are offsets to entries in the local stack.

YAP never compresses the local stack, so slots are respected by the garbage collector, hence providing a way to access terms without being exposed to stack shifts or garbage-collection

Space is released when the function terminates Thus, slots will be automatically released at the end of a function Hence, slots should always be used as local variables

Handles are organized as follows: -— Offset of next pointer in chain (tagged as an handle_t) -— Number of entries (tagged as handle_t), in the example TAG(INT,4) Entry Entry Entry Entry -— Number of entries (tagged as handle_t), in the example TAG(INT,4)

Handles are not known to the yaam Instead, A new set of slots is created when the emulator calls user C-code (see YAP_Execute* functions) They are also created: