D1: Out of memory problems

jicman via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 11 16:34:29 PDT 2015


On Saturday, 11 April 2015 at 20:45:25 UTC, Kagamin wrote:
> Parsers unique duplicated strings via a name table:
> string udup(string s, ref string[string] nameTable)
> {
>   if(s in nameTable)return nameTable[s];
>   string s1=s.dup;
>   nameTable[s1]=s1;
>   return s1;
> }
>
> This way you avoid extra duplicates. You can also try to free 
> file content manually when it's processed.

Hmmm...  Yes, definitely, that happens...  I will have to sit 
down and jump into out of memory abyss and how to handle it.  
Thanks.

josé


More information about the Digitalmars-d-learn mailing list