Tagged pointers
Factor handbook » The implementation » VM memory layouts

Prev:Type numbers
Next:Sizes and limits


Every pointer stored on the stack or in the heap has a tag, which is a small integer identifying the type of the pointer. If the tag is not equal to one of the two special tags, the remaining bits contain the memory address of a heap-allocated object. The two special tags are the fixnum tag and the f tag.

Words for working with tagged pointers:
tag-bits

tag-mask


The Factor VM does not actually expose any words for working with tagged pointers directly. The above words operate on integers; they are used in the bootstrap image generator and the optimizing compiler.