From: Zoltan B. <zb...@du...> - 2006-01-22 13:51:00
|
Hi, Zoltan Boszormenyi =C3=ADrta: > Now it's getting embarrassing... Fix again. Use this patch instead of=20 > the previous. > > Zoltan Boszormenyi =C3=ADrta: > >> Another fix. :-( This time incremental against the previous one. >> - Don't free something I didn't allocated. >> - Some white space fixes. > > > > Also check the return value of deflateEnd(), too. > > Best regards, > Zolt=C3=A1n B=C3=B6sz=C3=B6rm=C3=A9nyi here's a slightly cheaper version of the patch, as deflateInit() is done only in rpdf_new() and deflateEnd() is done in rpdf_free(). Instead, deflateReset() is used in rpdf_add_page_content_compressed(). $ time for i in `seq 1 1000` ; do ./test >test1.pdf ; done real 0m2.359s user 0m1.041s sys 0m1.311s Now the 1000 iterations took only 201 msecs more than without compression= . Also, should any error happen during compression, the next content won't = be compressed. It should only happen under OOM condition and I guess it's=20 very unlikely. Best regards, Zolt=C3=A1n B=C3=B6sz=C3=B6rm=C3=A9nyi |