On 2014-04-02 17:45, Andrea Fontana wrote:
auto example(char* test) { return toStringz(to!string(test) ~ " world!"); }When that return string will be freed?
When there is no reference left to the string, the garbage collector is free to collect it when it chooses to.
What about: extern(C) auto example(....)
Same as above, extern(C) does not change how memory is collected. If it is a C function, then it depends entirely on that particular function.
-- /Jacob Carlborg