branches/KDE/3.5/kdelibs/kio/kio

Nicolas Goutte nicolasg at snafu.de
Wed Dec 7 19:56:11 GMT 2005


On Wednesday 07 December 2005 20:42, Thiago Macieira wrote:
> Nicolas Goutte wrote:
> >> The whole diff has been read into memory by the time the license
> >> checker is run. So it has just to concatenate the diff from the array
> >> into one string and run the proper regexps against it.
> >
> >That is what is done currently. And you get memory overflows...
>
> Hmm... indeed. My original version didn't join everything, but it didn't
> work either.

>
> Also, it can't be what caused Michael's commit to fail, because the
> license check is run only when the file is first committed.

What is memory sensitive is that the full diff is loaded into an array and 
that this array is passed as parameters and that such array are processed.

Somewhere between all this the memory gets exhausted.

>
> I think we could limit the license check to the first 30 lines or so of
> the file.

I had that idea too. However I am not sure about how many lines are to be 
processed.

But perhaps the array could be handled like a window. If the first 30 lines 
are not enough, drop the first 10, and try with the next 10 ones and so on 
until the end of file. (Perhaps with an extra mark telling that the license 
is very low in the file, as it could mean that it is not the main license).

Have a nice day!





More information about the kde-core-devel mailing list