Hi José,

at a first glance this patch (and the one for plgradient) seems okay.
Only one tiny thing: I am not sure free() can be used with a NULL
argument. So, I'd say you have to guard against that. (If no one
picks this up, I will)

Regards,

Arjen

On 2010-12-23 09:55, José Luis García Pallero wrote:
>> On 2010-12-22 22:05-0700 Maurice LeBrun wrote:
>>> A cautionary note: PL_MAXPOLY impacts a fair amount of code.  Also there
>>> are
>>> heap-vs-stack performance implications -- e.g. directly moving from a
>>> fixed
>>> allocation to a malloc/free each time plfill() is called could suck for
>>> the
>>> many small-n-vertices polygon case.  Using per-stream polyline buffers is
>>> better but more convoluted.  The short term solution is definitely just
>>> recompile with a higher limit.
> 
> Attached I send a patch for svn plfill() that uses malloc/free in case
> of n > PL_MAXPOLY-1. I've used a behavior similar to the function
> plP_plfclp() in plfill.c. plP_plfclp tests if the number of point is
> greater than PL_MAXPOLY and uses static or dynamic array in
> consequence. I've done the same for c_plfill() and c_plfill3(), so for
> polygons with small number of vertices no overload is done for the
> using of malloc/free. This only introduces two if's sentences: for
> test if malloc must be used and for tests if free must be used. And
> deletes a if sentence: the check if ( n < PL_MAXPOLY ) in the test for
> determining if the last point is the same as the initial in tle
> polyline defining the polygon.
> 
> Can anyone check the patch?
> 
> Thanks
> 
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Learn how Oracle Real Application Clusters (RAC) One Node allows customers
> to consolidate database storage, standardize their database environment, and, 
> should the need arise, upgrade to a full multi-node Oracle RAC database 
> without downtime or disruption
> http://p.sf.net/sfu/oracle-sfdevnl
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Plplot-devel mailing list
> Plplot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/plplot-devel
 

DISCLAIMER: This message is intended exclusively for the addressee(s) and may 
contain confidential and privileged information. If you are not the intended 
recipient please notify the sender immediately and destroy this message. 
Unauthorized use, disclosure or copying of this message is strictly prohibited.
The foundation 'Stichting Deltares', which has its seat at Delft, The 
Netherlands, Commercial Registration Number 41146461, is not liable in any way 
whatsoever for consequences and/or damages resulting from the improper, 
incomplete and untimely dispatch, receipt and/or content of this e-mail.





------------------------------------------------------------------------------
Learn how Oracle Real Application Clusters (RAC) One Node allows customers
to consolidate database storage, standardize their database environment, and, 
should the need arise, upgrade to a full multi-node Oracle RAC database 
without downtime or disruption
http://p.sf.net/sfu/oracle-sfdevnl
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to