3 ms·
There is nothing difficult with that as long as the GC knows everything about strings and their pointers so it can detect that a particular string is reachable
by danieldk 11y ago
There is nothing difficult with that as long as the GC knows everything about strings and their pointers so it can detect that a particular string is reachable only through single another string.
Right, but that is a specific case where a built-in data type is optimized. It's not difficult, because the GC knows the semantics of a specific data type. But this does not work in the general case of slicing of library/used-defined data types.