how to pass a malloc'd C string over to be managed by the GC

Sam Johnson sam at durosoft.com
Thu Feb 28 04:26:47 UTC 2019


On Thursday, 28 February 2019 at 03:35:45 UTC, Sam Johnson wrote:
> On Thursday, 28 February 2019 at 03:33:25 UTC, Sam Johnson 
> wrote:
>> [...]
>
> Ignore the `.clone()` call -- that wasn't supposed to be here 
> -- I thought maybe string.clone() might exist but it turns out 
> it does not.

Update: it seems that all I need to do is GC.addRoot(output); and 
memory leak goes away. I think I have answered my own question.


More information about the Digitalmars-d-learn mailing list