<div dir="auto"><div>Yes, it reuse the same pointer. But it still a little bit slower than accessing stack memory<br><div class="gmail_extra"><br><div class="gmail_quote">Dne 7. 12. 2017 11:04 odp. napsal uživatel "Iain Buclaw via Digitalmars-d" <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>>:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 7 December 2017 at 20:56, Steven Schveighoffer via Digitalmars-d<br>
<div class="quoted-text"><<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br>
> On 12/7/17 1:26 PM, Daniel Kozak wrote:<br>
>><br>
>> This is not about write the best D code. It is about similar code to<br>
>> perform same. However when I looked at the D code it is not good port of<br>
>> C/C++. He made many mistakes which make it slower than C/C++ counterpart.<br>
>> One example is read_one_line function:<br>
>> C++: <a href="https://github.com/jpakkane/pkg-config/blob/cpp/parse.cpp#L60" rel="noreferrer" target="_blank">https://github.com/jpakkane/<wbr>pkg-config/blob/cpp/parse.cpp#<wbr>L60</a><br>
>> D: <a href="https://github.com/jpakkane/pkg-config/blob/d/parse.d#L57" rel="noreferrer" target="_blank">https://github.com/jpakkane/<wbr>pkg-config/blob/d/parse.d#L57</a><br>
><br>
><br>
> Wow, interesting that D uses less memory with that continue new char[1] in<br>
> there!<br>
><br>
<br>
</div>I would have thought that it just reuses the same pointer to the GC on<br>
each loop.<br>
</blockquote></div><br></div></div></div>