Pascal has ref-counted strings. If the user modifies such a string, then a new copy will be made unless the ref-count was equal to 1.

Would it be reasonable to request a flag to indicate data types with such behaviour? (Such a flag might only be present on types that have the newly requested DW_AT_ref_count)

Also, does anyone know similar behaviour in other language?
I wonder if "flag" is the appropriate form.

For Pascal it would currently be enough. Since it only applies to strings, and strings can not be nested.

If a language had a refcounted array or structure type, then such a type could contain other (nested) ref-counted types (e.g. via pointer/reference). There could then be a case where modifying a nested ref-counted array, triggers copy on write for the outer array too?
In that case a flag may not be able to express that.

--
Dwarf-discuss mailing list
[email protected]
https://lists.dwarfstd.org/mailman/listinfo/dwarf-discuss

Reply via email to