Newbie: Error parsing csv file with very long lines

rikki cattermole via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 23 04:18:08 PDT 2016


On 23/04/2016 10:57 PM, salvari wrote:
> Fixed!!!
>
> Thanks a lot. :-)
>
>
> But I have to think about this. I don't understand the failure.

.dup duplicates memory.
What this means is, it allocates a new block of memory and copies the 
values across.

What byLine does is, read up to \n and copies it into a buffer of memory.
Then you get access to said buffer aka line.
So it reuses the memory containing said line, meaning no allocations 
beyond the first and growth of it.


More information about the Digitalmars-d-learn mailing list