On 1/13/07, Nuno Lopes <[EMAIL PROTECTED]> wrote:
nlopess Sat Jan 13 11:16:15 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/gd/libgd gd.c
Log:
fix valgrind error in test bug24594.phpt
while at it, remove some dead code and change the pts vector to char to
save (much) memory
# Pierre: one more to merge ;)
Thanks for the catch. I like to merge (and keep the fix) if I know
what you are fixing. Can you send me the details please?
As the commit log says, I fixed a few valgrind warnings in the bug24594.phpt
test (it was reading one past the end of the array). The log is still
available at
http://gcov.php.net/viewer.php?version=PHP_5_2&func=valgrind&file=ext%2Fgd%2Ftests%2Fbug24594.phpt
the fix is this part:
- for (; x<=wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc) ; x++) {
+ for (; x<wx2 && (!pts[y][x] && gdImageGetPixel(im,x, y)==oc) ; x++) {
About removing the dead code, again I do not like to do it during the
RC phase. Please do it __after__ 5.2.1 (take #2) if there is a very
good reason to do it, but I like to keep it (as I voluntary kept it).
It is really dead code and it was even marked as such. It is impossible
(excluding compiler/cpu/memory/.. bugs) to reach the code I removed.
If you feel scary with such trivial changes that means the extension hasn't
enough tests :P (ok, kidding. that part of the code is covered)
OMG, this line was really bogus (and allocating huge amounts of memory
unnecessarily)
It was more wrong after your change (int -> char) but as I said I did
not see good reasons to change that now. Or is it critical and if yes
how?
it is critical to my point of view :) Before my patch it would take 4 times
more memory than after the patch. With larger images, it is critical :P
The code can still be further optimized when using square images, but I
didn't deliberately make such change in an RC phase and without your
approval.
Nuno
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php