Next: , Previous: , Up: Garbage Collection - Step by Step   [Contents][Index]

11.4.7 sweep_strings

The sweeping for the fixed sized string objects is essentially exactly the same as it is for all other fixed size types. As before, the freeing into the suitable free list is done by using the macro SWEEP_FIXED_SIZE_BLOCK after defining the right macros UNMARK_string and ADDITIONAL_FREE_string. These two definitions are a little bit special compared to the ones used for the other fixed size types.

UNMARK_string is defined the same way except some additional code used for updating the bookkeeping information.

For strings, ADDITIONAL_FREE_string has to do something in addition: in case, the string was not allocated in a string_chars_block because it exceeded the maximal length, and therefore it was malloced separately, we know also xfree it explicitly.