Detail of so bump

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Detail of so bump

Post by broucaries »

Could you please give use:
- detail of so bump
- why ?
- and the api change

thank you
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Detail of so bump

Post by magick »

To increase performance primarily on smart phones we changed MagickRealType from double to float which required an SO bump. There is a corresponding performance boost on desktops as well. You can avoid any API incompatibility simply by restoring MagickRealType to double in magick/magick-type.h:
  • typedef double MagickRealType;
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Detail of so bump

Post by broucaries »

Sorry but it could be slow on big arch.

According to C99 standard
The types float_t and double_t are intended to be the implementation’s most efficient types at least as wide as float and double, respectively.

So you should use float_t instaed of float.

Bastien
broucaries
Posts: 467
Joined: 2008-12-21T11:51:10-07:00

Re: Detail of so bump

Post by broucaries »

Notice that you could not use it in an abi due to depends on FLT_EVAL_METHOD defined variable*. You need to test it a configure time by comparing float_t size against long double, double and float size

*The types float_t double_t
are floating types at least as wide as float and double, respectively, and such that double_t is at least as wide as float_t. If FLT_EVAL_METHOD equals 0, float_t and double_t are float and double, respectively; if FLT_EVAL_METHOD equals 1, they are both double; if FLT_EVAL_METHOD equals 2, they are both long double; and for other values of FLT_EVAL_METHOD, they are otherwise implementation-defined.178)
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Detail of so bump

Post by magick »

Thanks for the tip, we're looking into float_t / double_t now. It will need to be conditional of course since not all compilers support C99.
Post Reply