The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

A doc_map is used when consolidating a segment. It's a C array of U32 (stored in a scalar) where the offset from the start represents the original doc_num, and the value represents the new doc_num. _get_doc_map maps around deleted docs, hence the name: if doc 2 is deleted, the map will be 0, 1, -1, 2, 3...