D1: Out of memory problems
jicman via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Tue Apr 7 08:26:21 PDT 2015
On Tuesday, 7 April 2015 at 08:58:31 UTC, Kagamin wrote:
> Depends on how you fill aTUs.
Ok, I will bite... ;-)
I have the wText string which could be 20 mgs or so, I start
finding pieces of data like this,
wText = wText[std.string.find(wText,"</ut>") + 5 .. $];
so, everything before </ut>, including it, will be thrown out,
correct? So, I continue like this, until I find a piece of the
string that I want, and then, I fill the aTUs, like this,
aTUs = AddToTrackerRepeat(aTUs, source, fn, 1, target);
where:
source is a part of the string wanted
fn is the file name that the string was found
1 is a count
target is the other set of string wanted
And these are the other pieces missing:
TUCount [char[]] AddToTrackerRepeat(TUCount[char[]] T, char[]
tu, char[] f, int add, char[] target)
{
// target = target
// f = filename
// tu = translation unit
// add = amount to be added
if ((tu in T) == null)
{
T[tu] = new TUCount();
T[tu].Count = 0;
T[tu].File[f] = 0;
}
T[tu].Count += add;
T[tu].File[f] += add;
T[tu].Target[f ~ "\t" ~ std.string.toString(T[tu].File[f]) ]
= target;
return T;
}
class TUCount
{
int[char[]] File;
char[][char[]] Target;
int Count;
}
More information about the Digitalmars-d-learn
mailing list