--- In [email protected], Julien Pierrehumbert <[EMAIL PROTECTED]> wrote: > > swzoh wrote: > > It always crashed PP if I applied the pattern to the whole file. > > There seemed to be a problem with memory management by regex plugin. > > So, I changed it to parse line by line, and succeeded without a > > problem > > Independently of any bugs in the plugin or the library, doing such an > operation in smaller chunks would indeed be a better idea if it can be > done easily. > > That said, there was a serious bug in the memory management code in 1.2 > and 1.3. Those versions were very inefficient too. > There's still stuff I want to optimize (string concatenation) but I've > processed many large strings to test my optimizations so far and didn't > crash PP in the process (using 1.4) so I would be interested in seeing > the file and the expression in question if you still have those.
It seemed that I didn't keep the pattern which crashed PP, only kept the one which succeeded: ---------------------------------------------------------------------- local _perfcount_=perfcount local fh=file.open(pprofolder++"win32api_2.txt","r") local api=vec.create(0,1) for() local str=fh.readstring if(fh.eof) break ; below were actually in 1 line if(regex.match(str,?'Declare\s+(?:Function|Sub)\s+(\w+)\s+Lib\s+;;+ "([\w]+)(?:\.\w+)?"\s+(?:Alias(\s+)"(\w+)"\s+)?.*',;;+ ?"\1\3\4, \2,"++regex.mg(str,?"\s+As(\s+\w+)",?"\1");;+ ++regex.m1(str,?"\)$"," Void"),"str")) break api.bininsert(str) endfor file.writeall(pprofolder++"win32api.txt",api.MakeLines) quit(osd.show(int64.divide(int64.sub(perfcount,_perfcount_),perffreq))) ---------------------------------------------------------------------- The idea was to stripped out unnecessary words and reordering the type specs to accord with the convention of dll plugin. Actually I stripped out too much, so no indication of pointer types in the result file. Anyway I uploaded the source and result file in the Files/Temp section as win32api.zip. It's size is of 690KB which is too big, so if you got it please notify me so as to delete the file immediately. > > These two were the symptoms I experienced with the latest regex > > build. > > Are you sure? I uploaded a new one last week. > I meant the one before 1.4 which I haven't tried yet. BTW, which one have you tested: the one with PCRE 6.1 or the one with PCRE 6.7? BTW, I'd like to know if can use UTF-8 via regex.dll, which looks like the best choice when dealing with multi-byte characters. In my test, it seemed to not work. Sean Attention: PowerPro's Web site has moved: http://www.ppro.org Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/power-pro/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/power-pro/join (Yahoo! ID required) <*> To change settings via email: mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
