Hi all
After sucessfully installing GPC I tried the following (basically a loop around the stringutils test-program). However it seems to have a memoryleak, after a while (~14%MEM on my machine) it comes out with a segmentation fault (and with top you can see that the memory usage grows)... What am I doing wrong?
Best regards
Preben Bohn
program test1;
uses GPC, stringutils;
var tokens : PPStrings; line : string; lineNumber : integer; c : charset; begin c := ['¤']; lineNumber := 0; while lineNumber < 1000000 do begin line := 'string1¤string2¤string3¤string4¤string5¤string6'; inc(lineNumber); tokens := TokenizeString (line, c); if (linenumber mod 10) = 0 then begin writeln('Line number : ', lineNumber); writeln(tokens^[1]^ + ' ' + tokens^[2]^+ ' ' + tokens^[3]^+ ' ' + tokens^[4]^+ ' ' + tokens^[5]^+ ' ' + tokens^[6]^); end; DisposePPStrings (tokens); end; end.
=====
__________________________________________________ Do You Yahoo!? Everything you'll ever need on one web page from News and Sport to Email and Music Charts http://uk.my.yahoo.com