cy wrote:

On Saturday, 11 March 2017 at 23:43:54 UTC, Nicholas Wilson wrote:
A string *is* a pointer length pair, an immutable(char)[].

Yes, but surely there's some silly requirement, like that the pointer must only ever point to garbage collected memory, or something?

why should it? a slice can point anywhere, and GC is smart enough to know what memory it owns and what it isn't. if you'll try to append something to non-GC-owned slice, GC will make a copy first. so the only requirement is: "don't use `~=` on it if you don't want to have a memory leak".

Reply via email to