Want to read a whole file as utf-8

Foo via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Feb 3 14:33:28 PST 2015


On Tuesday, 3 February 2015 at 19:56:37 UTC, FG wrote:
> On 2015-02-03 at 20:50, Tobias Pankrath wrote:
>> Use std.utf.validate instead of decode. It will only allocate 
>> one exception if necessary.
>
> Looks to me like it uses decode internally...
>
> But Foo, do you have to use @nogc? It still looks like it's 
> work in progress,
> and lack of it doesn't mean that the GC is actually involved in 
> the function.
> It will probably take several months for the obvious nogc parts 
> of the std lib
> to get annotated, and much longer to get rid of unnecessary use 
> of the GC.
> So maybe the solution for now is to verify the source code of 
> the function in
> question with ones own set of eyeballs and decide if it's good 
> enough for use,
> ie. doesn't leak too much?

Yes, we don't want to use a GC. We want determinsitic life times. 
I'm not the boss, but I support the idea.

@Nordlöw Neither of them can be marked with @nogc. :/


More information about the Digitalmars-d-learn mailing list