The purpose of this function is to compact all the data parts of the
strings that are held in so-called
string_chars_block, i.e. the
strings that do not exceed a certain maximal length.
The procedure with which this is done is as follows. We are keeping two
positions in the
string_chars_blocks using two pointer/integer
to_pos. They stand for the actual positions, from
where to where, to copy the actually handled string.
While going over all chained
string_char_blocks and their held
strings, staring at
first_string_chars_block, both pointers
are advanced and eventually a string is copied from
to_sb, depending on the status of the pointed at strings.
More precisely, we can distinguish between the following actions.
from_sb’s position could be marked as free, which is indicated by an invalid pointer to the pointer that should point back to the fixed size string object, and which is checked by
FREE_STRUCT_P. In this case, the
from_posis advanced to the next string, and nothing has to be copied.
from_pospair as described above.
to_sb-block, we advance this pointer to the beginning of the next block before copying. In case the from and to positions are different, we perform the actual copying using the library function
After compacting, the pointer to the current
string_chars_block, sitting in
is reset on the last block to which we moved a string,
to_block, and all remaining blocks (we know that they just
carry garbage) are explicitly