[GiNaC-list] Non-reentrant code in GCD functions

Richard B. Kreckel kreckel at ginac.de
Sun Jun 13 23:04:11 CEST 2010


Hi!

Jens Vollinga wrote:
> Am 13.06.2010 21:07, schrieb Alexei Sheplyakov:
>> Could you please be more specific? I can see several static const 
>> variables,
>> for instance,
> 
> like in primpart_content.cpp
> 
> 44 void primpart_content(ex& pp, ex& c, ex e, const exvector& vars,
> 45                       const long p)
> 46 {
> 47        static const ex ex1(1);
> 48        static const ex ex0(0);

Is there a reason why this code isn't using the flyweights from 
utils.cpp directly? And, could these flyweights be safe in a threaded 
environment? I would assume no thread ever deallocates them since their 
refcount stays above zero all the time. Wrong?

Best wishes
    -richy.
-- 
Richard B. Kreckel
<http://www.ginac.de/~kreckel/>


More information about the GiNaC-list mailing list